]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libcompat/4.1/vlimit.3
Add $Id$, to make it simpler for members of the translation teams to
[FreeBSD/FreeBSD.git] / lib / libcompat / 4.1 / vlimit.3
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)vlimit.3    8.1 (Berkeley) 6/4/93
33 .\"     $Id$
34 .\"
35 .Dd June 4, 1993
36 .Dt VLIMIT 3
37 .Os BSD 4
38 .Sh NAME
39 .Nm vlimit
40 .Nd control maximum system resource consumption
41 .Sh SYNOPSIS
42 .Fd #include <sys/vlimit.h>
43 .Fn vlimit resource value
44 .Sh DESCRIPTION
45 .Bf -symbolic
46 This interface is obsoleted by getrlimit(2).
47 It is available from the compatibility library, libcompat.
48 .Ef
49 .Pp
50 Limits the consumption by the current process and each process
51 it creates to not individually exceed 
52 .Fa value
53 on the specified
54 .Fa resource .
55 If
56 .Fa value
57 is specified as \-1, then the current limit is returned and the
58 limit is unchanged.
59 The resources which are currently controllable are:
60 .Bl -tag -width LIM_NORAISE
61 .It Dv LIM_NORAISE
62 A pseudo-limit; if set non-zero then the limits may not be raised.
63 Only the super-user may remove the
64 .Em noraise
65 restriction.
66 .It Dv LIM_CPU
67 the maximum
68 number of cpu-seconds to be used by each process
69 .It Dv LIM_FSIZE
70 the largest single file which can be created
71 .It Dv LIM_DATA
72 the maximum growth of the data+stack region via
73 .Xr sbrk 2
74 beyond the end of the program text
75 .It Dv LIM_STACK
76 the maximum
77 size of the automatically-extended stack region
78 .It Dv LIM_CORE
79 the size of the largest core dump that will be created.
80 .It Dv LIM_MAXRSS
81 a soft limit for the amount of physical memory (in bytes) to be given
82 to the program.  If memory is tight, the system will prefer to take memory
83 from processes which are exceeding their declared
84 .Dv LIM_MAXRSS.
85 .El
86 .Pp
87 Because this information is stored in the per-process information
88 this system call must be executed directly by the shell if it
89 is to affect all future processes created by the shell;
90 .Xr limit
91 is thus a built-in command to
92 .Xr csh 1 .
93 .Pp
94 The system refuses to extend the data or stack space when the limits
95 would be exceeded in the normal way; a
96 .Xr brk 2
97 call fails if the data space limit is reached, or the process is
98 killed when the stack limit is reached (since the stack cannot be
99 extended, there is no way to send a signal!).
100 .Pp
101 A file
102 .Tn I/O
103 operation which would create a file which is too large
104 will cause a signal
105 .Dv SIGXFSZ
106 to be generated, this normally terminates
107 the process, but may be caught.
108 When the cpu time limit is exceeded, a signal
109 .Dv SIGXCPU
110 is sent to the
111 offending process; to allow it time to process the signal it is
112 given 5 seconds grace by raising the
113 .Tn CPU
114 time limit.
115 .Sh SEE ALSO
116 .Xr csh 1
117 .Sh HISTORY
118 The
119 .Fn vlimit
120 function appeared in 
121 .Bx 4.2 .
122 .Sh BUGS
123 .Dv LIM_NORAISE
124 no longer exists.
125
126 This function has not yet been reimplemented.