1ULIMIT(3) Linux Programmer's Manual ULIMIT(3)
2
3
4
6 ulimit - get and set user limits
7
9 #include <ulimit.h>
10
11 long ulimit(int cmd, long newlimit);
12
14 Warning: this routine is obsolete. Use getrlimit(2), setrlimit(2), and
15 sysconf(3) instead. For the shell command ulimit(), see bash(1).
16
17 The ulimit() call will get or set some limit for the calling process.
18 The cmd argument can have one of the following values.
19
20 UL_GETFSIZE
21 Return the limit on the size of a file, in units of 512 bytes.
22
23 UL_SETFSIZE
24 Set the limit on the size of a file.
25
26 3 (Not implemented for Linux.) Return the maximum possible ad‐
27 dress of the data segment.
28
29 4 (Implemented but no symbolic constant provided.) Return the
30 maximum number of files that the calling process can open.
31
33 On success, ulimit() returns a nonnegative value. On error, -1 is re‐
34 turned, and errno is set appropriately.
35
37 EPERM An unprivileged process tried to increase a limit.
38
40 For an explanation of the terms used in this section, see at‐
41 tributes(7).
42
43 ┌──────────┬───────────────┬─────────┐
44 │Interface │ Attribute │ Value │
45 ├──────────┼───────────────┼─────────┤
46 │ulimit() │ Thread safety │ MT-Safe │
47 └──────────┴───────────────┴─────────┘
48
50 SVr4, POSIX.1-2001. POSIX.1-2008 marks ulimit() as obsolete.
51
53 bash(1), getrlimit(2), setrlimit(2), sysconf(3)
54
56 This page is part of release 5.10 of the Linux man-pages project. A
57 description of the project, information about reporting bugs, and the
58 latest version of this page, can be found at
59 https://www.kernel.org/doc/man-pages/.
60
61
62
63Linux 2017-09-15 ULIMIT(3)