manual page distributed with 4.1BSD
[unix-history] / usr / src / lib / libcompat / 4.1 / vlimit.3
CommitLineData
59c7bf5e
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)vlimit.3 4.1 (Berkeley) %G%
6.\"
7.TH VLIMIT 2V
8.UC 4
9.SH NAME
10vlimit \- control maximum system resource consumption
11.SH SYNOPSIS
12.B "#include <sys/vlimit.h>"
13.PP
14.B vlimit(resource, value)
15.SH DESCRIPTION
16Limits the consumption by the current process and each process
17it creates to not individually exceed
18.I value
19on the specified
20.I resource.
21If
22.I value
23is specified as \-1, then the current limit is returned and the
24limit is unchanged.
25The resources which are currently controllable are:
26.TP 15
27.B LIM_NORAISE
28A pseudo-limit; if set non-zero then the limits may not be raised.
29Only the super-user may remove the \fInoraise\fR restriction.
30.TP 15
31.B LIM_CPU
32the maximum
33number of cpu-seconds to be used by each process
34.TP 15
35.B LIM_FSIZE
36the largest single file which can be created
37.TP 15
38.B LIM_DATA
39the maximum growth of the data+stack region via
40.IR sbrk (2)
41beyond the end of the program text
42.TP 15
43.B LIM_STACK
44the maximum
45size of the automatically-extended stack region
46.TP 15
47.B LIM_CORE
48the size of the largest core dump that will be created.
49.TP 15
50.B LIM_MAXRSS
51a soft limit for the amount of physical memory (in bytes) to be given
52to the program. If memory is tight, the system will prefer to take memory
53from processes which are exceeding their declared LIM_MAXRSS.
54.PP
55Because this information is stored in the per-process information
56this system call must be executed directly by the shell if it
57is to affect all future processes created by the shell;
58.I limit
59is thus a built-in command to
60.IR csh (1).
61.PP
62The system refuses to extend the data or stack space when the limits
63would be exceeded in the normal way; a
64.I break
65call fails if the data space limit is reached, or the process is
66killed when the stack limit is reached (since the stack cannot be
67extended, there is no way to send a signal!).
68.PP
69A file i/o operation which would create a file which is too large
70will cause a signal SIGXFSZ to be generated, this normally terminates
71the process, but may be caught.
72When the cpu time limit is exceeded, a signal SIGXCPU is sent to the
73offending process; to allow it time to process the signal it is
74given 5 seconds grace by raising the cpu time limit.
75.SH SEE ALSO
76csh(1)
77.SH BUGS
78If LIM_NORAISE is set, then no grace should be given when the cpu
79time limit is exceeded.
80.PP
81There should be
82.I limit
83and
84.I unlimit
85commands in
86.IR sh (1)
87as well as in
88.IR csh.
89.PP
90This call is peculiar to this version of UNIX.
91The options and specifications of this system call and even the call itself
92are subject to change. It may be extended or replaced by other
93facilities in future versions of the system.