4.3BSD/usr/man/man3/vlimit.3c

.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved.  The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\"	@(#)vlimit.3c	6.2 (Berkeley) 5/12/86
.\"
.TH VLIMIT 3C "May 12, 1986"
.UC 4
.SH NAME
vlimit \- control maximum system resource consumption
.SH SYNOPSIS
.B "#include <sys/vlimit.h>"
.PP
.B vlimit(resource, value)
.SH DESCRIPTION
.ft B
This facility is superseded by getrlimit(2).
.ft R
.PP
Limits the consumption by the current process and each process
it creates to not individually exceed 
.I value
on the specified
.I resource.
If
.I value
is specified as \-1, then the current limit is returned and the
limit is unchanged.
The resources which are currently controllable are:
.TP 15
LIM_NORAISE
A pseudo-limit; if set non-zero then the limits may not be raised.
Only the super-user may remove the \fInoraise\fR restriction.
.TP 15
LIM_CPU
the maximum
number of cpu-seconds to be used by each process
.TP 15
LIM_FSIZE
the largest single file which can be created
.TP 15
LIM_DATA
the maximum growth of the data+stack region via
.IR sbrk (2)
beyond the end of the program text
.TP 15
LIM_STACK
the maximum
size of the automatically-extended stack region
.TP 15
LIM_CORE
the size of the largest core dump that will be created.
.TP 15
LIM_MAXRSS
a soft limit for the amount of physical memory (in bytes) to be given
to the program.  If memory is tight, the system will prefer to take memory
from processes which are exceeding their declared LIM_MAXRSS.
.PP
Because this information is stored in the per-process information
this system call must be executed directly by the shell if it
is to affect all future processes created by the shell;
.I limit
is thus a built-in command to
.IR csh (1).
.PP
The system refuses to extend the data or stack space when the limits
would be exceeded in the normal way; a
.I break
call fails if the data space limit is reached, or the process is
killed when the stack limit is reached (since the stack cannot be
extended, there is no way to send a signal!).
.PP
A file i/o operation which would create a file which is too large
will cause a signal SIGXFSZ to be generated, this normally terminates
the process, but may be caught.
When the cpu time limit is exceeded, a signal SIGXCPU is sent to the
offending process; to allow it time to process the signal it is
given 5 seconds grace by raising the cpu time limit.
.SH SEE ALSO
csh(1)
.SH BUGS
LIM_NORAISE no longer exists.