Debian Codegraph @

upstream/debian-unstable/man3/ulimit.3

raw
1 '\" t
2 .\" Copyright 1996, Andries E. Brouwer <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH ulimit 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 ulimit \- get and set user limits
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ,\~ \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <ulimit.h>
16 .P
17 .BI "[[deprecated]] long ulimit(int " cmd ", long " newlimit );
18 .fi
19 .SH DESCRIPTION
20 Warning: this routine is obsolete.
21 Use
22 .BR getrlimit (2),
23 .BR setrlimit (2),
24 and
25 .BR sysconf (3)
26 instead.
27 For the shell command
28 .BR ulimit ,
29 see
30 .BR bash (1).
31 .P
32 The
33 .BR ulimit ()
34 call will get or set some limit for the calling process.
35 The
36 .I cmd
37 argument can have one of the following values.
38 .TP
39 .B UL_GETFSIZE
40 Return the limit on the size of a file, in units of 512 bytes.
41 .TP
42 .B UL_SETFSIZE
43 Set the limit on the size of a file.
44 .TP
45 .B 3
46 (Not implemented for Linux.)
47 Return the maximum possible address of the data segment.
48 .TP
49 .B 4
50 (Implemented but no symbolic constant provided.)
51 Return the maximum number of files that the calling process can open.
52 .SH RETURN VALUE
53 On success,
54 .BR ulimit ()
55 returns a nonnegative value.
56 On error, \-1 is returned, and
57 .I errno
58 is set to indicate the error.
59 .SH ERRORS
60 .TP
61 .B EPERM
62 An unprivileged process tried to increase a limit.
63 .SH ATTRIBUTES
64 For an explanation of the terms used in this section, see
65 .BR attributes (7).
66 .TS
67 allbox;
68 lbx lb lb
69 l l l.
70 Interface Attribute Value
71 T{
72 .na
73 .nh
74 .BR ulimit ()
75 T} Thread safety MT-Safe
76 .TE
77 .SH STANDARDS
78 POSIX.1-2008.
79 .SH HISTORY
80 SVr4, POSIX.1-2001.
81 POSIX.1-2008 marks it as obsolete.
82 .SH SEE ALSO
83 .BR bash (1),
84 .BR getrlimit (2),
85 .BR setrlimit (2),
86 .BR sysconf (3)