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 | .\" | |
79e6b3c8 | 5 | .\" @(#)vlimit.3 6.3 (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 | 16 | .ft B |
79e6b3c8 KB |
17 | This interface is obsoleted by getrlimit(2). |
18 | .br | |
19 | It is available from the compatibility library, libcompat. | |
374b2a7f KM |
20 | .ft R |
21 | .PP | |
59c7bf5e KM |
22 | Limits the consumption by the current process and each process |
23 | it creates to not individually exceed | |
24 | .I value | |
25 | on the specified | |
26 | .I resource. | |
27 | If | |
28 | .I value | |
29 | is specified as \-1, then the current limit is returned and the | |
30 | limit is unchanged. | |
31 | The resources which are currently controllable are: | |
32 | .TP 15 | |
374b2a7f | 33 | LIM_NORAISE |
59c7bf5e KM |
34 | A pseudo-limit; if set non-zero then the limits may not be raised. |
35 | Only the super-user may remove the \fInoraise\fR restriction. | |
36 | .TP 15 | |
374b2a7f | 37 | LIM_CPU |
59c7bf5e KM |
38 | the maximum |
39 | number of cpu-seconds to be used by each process | |
40 | .TP 15 | |
374b2a7f | 41 | LIM_FSIZE |
59c7bf5e KM |
42 | the largest single file which can be created |
43 | .TP 15 | |
374b2a7f | 44 | LIM_DATA |
59c7bf5e KM |
45 | the maximum growth of the data+stack region via |
46 | .IR sbrk (2) | |
47 | beyond the end of the program text | |
48 | .TP 15 | |
374b2a7f | 49 | LIM_STACK |
59c7bf5e KM |
50 | the maximum |
51 | size of the automatically-extended stack region | |
52 | .TP 15 | |
374b2a7f | 53 | LIM_CORE |
59c7bf5e KM |
54 | the size of the largest core dump that will be created. |
55 | .TP 15 | |
374b2a7f | 56 | LIM_MAXRSS |
59c7bf5e KM |
57 | a soft limit for the amount of physical memory (in bytes) to be given |
58 | to the program. If memory is tight, the system will prefer to take memory | |
59 | from processes which are exceeding their declared LIM_MAXRSS. | |
60 | .PP | |
61 | Because this information is stored in the per-process information | |
62 | this system call must be executed directly by the shell if it | |
63 | is to affect all future processes created by the shell; | |
64 | .I limit | |
65 | is thus a built-in command to | |
66 | .IR csh (1). | |
67 | .PP | |
68 | The system refuses to extend the data or stack space when the limits | |
69 | would be exceeded in the normal way; a | |
70 | .I break | |
71 | call fails if the data space limit is reached, or the process is | |
72 | killed when the stack limit is reached (since the stack cannot be | |
73 | extended, there is no way to send a signal!). | |
74 | .PP | |
75 | A file i/o operation which would create a file which is too large | |
76 | will cause a signal SIGXFSZ to be generated, this normally terminates | |
77 | the process, but may be caught. | |
78 | When the cpu time limit is exceeded, a signal SIGXCPU is sent to the | |
79 | offending process; to allow it time to process the signal it is | |
80 | given 5 seconds grace by raising the cpu time limit. | |
81 | .SH SEE ALSO | |
82 | csh(1) | |
83 | .SH BUGS | |
3311b706 | 84 | LIM_NORAISE no longer exists. |