]>
Commit | Line | Data |
---|---|---|
9385eb3d | 1 | .\" Copyright (c) 2002 Kyle Martin. All rights reserved. |
5b2abdfb A |
2 | .\" |
3 | .\" Redistribution and use in source and binary forms, with or without | |
4 | .\" modification, are permitted provided that the following conditions | |
5 | .\" are met: | |
6 | .\" 1. Redistributions of source code must retain the above copyright | |
7 | .\" notice, this list of conditions and the following disclaimer. | |
8 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
9 | .\" notice, this list of conditions and the following disclaimer in the | |
10 | .\" documentation and/or other materials provided with the distribution. | |
11 | .\" | |
12 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
13 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
14 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
15 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
16 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
17 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
18 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
19 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
20 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
21 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
22 | .\" SUCH DAMAGE. | |
23 | .\" | |
9385eb3d | 24 | .\" $FreeBSD: src/lib/libc/gen/ulimit.3,v 1.5 2003/01/04 01:11:49 tjr Exp $ |
5b2abdfb | 25 | .\" |
9385eb3d A |
26 | .Dd January 4, 2003 |
27 | .Dt ULIMIT 3 | |
5b2abdfb A |
28 | .Os |
29 | .Sh NAME | |
9385eb3d A |
30 | .Nm ulimit |
31 | .Nd get and set process limits | |
5b2abdfb A |
32 | .Sh LIBRARY |
33 | .Lb libc | |
34 | .Sh SYNOPSIS | |
9385eb3d A |
35 | .In ulimit.h |
36 | .Ft long | |
ad3c9f2a A |
37 | .Fo ulimit |
38 | .Fa "int cmd" | |
39 | .Fa "..." | |
40 | .Fc | |
5b2abdfb A |
41 | .Sh DESCRIPTION |
42 | The | |
9385eb3d A |
43 | .Fn ulimit |
44 | function will get and set process limits. | |
ad3c9f2a | 45 | Currently, this is limited to the maximum file size. |
9385eb3d A |
46 | The |
47 | .Fa cmd | |
48 | argument is one of the following: | |
49 | .Bl -tag -width ".Dv UL_GETFSIZE" | |
50 | .It Dv UL_GETFSIZE | |
ad3c9f2a A |
51 | will return the maximum file size of the current process, |
52 | in units of 512-byte blocks. | |
9385eb3d A |
53 | .It Dv UL_SETFSIZE |
54 | will attempt to set the maximum file size of the current | |
ad3c9f2a | 55 | process and its children, using the second argument (expressed as a long). |
9385eb3d | 56 | .El |
5b2abdfb | 57 | .Sh RETURN VALUES |
9385eb3d A |
58 | Upon successful completion, |
59 | .Fn ulimit | |
60 | returns the value requested; | |
ad3c9f2a | 61 | otherwise, the value \-1 is returned and the global variable |
9385eb3d A |
62 | .Va errno |
63 | is set to indicate the error. | |
64 | .Sh ERRORS | |
65 | The | |
66 | .Fn ulimit | |
67 | function will fail if: | |
68 | .Bl -tag -width Er | |
69 | .It Bq Er EINVAL | |
70 | The command specified was invalid. | |
71 | .It Bq Er EPERM | |
72 | The limit specified to | |
73 | .Fn ulimit | |
74 | would have raised the maximum limit value, | |
75 | and the caller is not the super-user. | |
76 | .El | |
5b2abdfb | 77 | .Sh SEE ALSO |
9385eb3d | 78 | .Xr getrlimit 2 |
5b2abdfb A |
79 | .Sh STANDARDS |
80 | The | |
9385eb3d | 81 | .Fn ulimit |
5b2abdfb | 82 | function conforms to |
9385eb3d | 83 | .St -p1003.1-2001 . |
5b2abdfb A |
84 | .Sh HISTORY |
85 | The | |
9385eb3d | 86 | .Fn ulimit |
5b2abdfb A |
87 | function first appeared in |
88 | .Fx 5.0 . | |
9385eb3d A |
89 | .Sh BUGS |
90 | The | |
91 | .Fn ulimit | |
92 | function provides limited precision for | |
93 | setting and retrieving process limits. | |
94 | If there is a need for greater precision than the | |
95 | type | |
96 | .Vt long | |
97 | provides, the | |
98 | .Xr getrlimit 2 | |
99 | and | |
100 | .Xr setrlimit 2 | |
101 | functions should be considered. |