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