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