RLIMIT(1) BSD Reference Manual RLIMIT(1)NAMErlimit - change process limits
SYNOPSISrlimit [-huv] [-p pid] [resource [maximum-use]]
DESCRIPTION
The rlimit command limits the consumption by the target process and each
process it creates to not individually exceed maximum-use of the speci-
fied resource. If maximum-use is not specified, then the current limit is
printed; if resource is not specified, then the current limits on all re-
sources are displayed.
The following options are available:
-h If the -h option is specified, the hard limits are used instead
of the current limits. The hard limits impose a ceiling on the
values of the current limits. Only the super-user may raise the
hard limits, but a user may lower or raise the current limits
within the legal range.
-p Normally the limits for the current process are printed or
changed. The -p allows the specification of which process should
be queried or altered. You must either have the same user id as
the target process or be super-user to query or alter another
process.
-u Normally limits are printed in abbreviated for, i.e., 2K instead
of 2048. The -u option turns off abbreviations and the full val-
ue is printed.
-v The -v option causes both the current and hard limit to be dis-
played. A textual definition of the resource is printed rather
than the resource name.
Controllable resources include:
coredumpsize
The largest size core file that may be created.
cputime
The maximum amount of cpu time to be used by each process.
datasize
The maximum size of the data segment for the process; this de-
fines how far a program may extend its break with the sbrk(2)
system call.
filesize
The largest size file that may be created.
maxproc
The maximum number of simultaneous processes for this user id.
memorylocked
The maximum size which the process may lock into memory using the
mlock(2) function.
memoryuse
The maximum size to which the process's resident set size may
grow. This imposes a limit on the amount of physical memory to
be given to a process; if memory is tight, the system will prefer
to take memory from processes that are exceeding their declared
resident set size.
openfiles
The maximum number of open files for the process.
stacksize
The maximum size of the stack segment for the process; this de-
fines how far a program's stack segment may be extended. Stack
extension is performed automatically by the system.
The maximum-use argument may be specified as an integer number followed
by a scale factor. For all limits other than cputime, multiple numbers,
with scale factors, may be multiplied together by using ``x.'' (I.e.,
5x1024.) The scale factors for limits other than cputime are:
b the number is multiplied by 512
k the number is multiplied by 1024
m the number is multiplied by 1024*1024
g the number is multiplied by 1024*1024*1024
t the number is multiplied by 1024*1024*1024*1024
For cputime, multiple numbers with scale factors may simply be concate-
nated together. (I.e., 1h30m.) The scale factors available are:
s seconds
m minutes (multiplied by 60)
h hours (multiplied by 60*60)
d days (multiplied by 60*60*24)
w weeks (multiplied by 60*60*24*7)
y years (multiplied by 60*60*24*365)
The rlimit command exits 0 on success, and >0 if an error occurs.
SEE ALSOgetprlimit(8), setprlimit(8)
September 7, 1999 2