ioctl_tty.2: Document ioctls: TCGETS2, TCSETS2, TCSETSW2, TCSETSF2
[man-pages.git] / man3 / ulimit.3
blob889f2c60dc1fca3d32bd00cd17306f5cd216e9fb
1 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Moved to man3, aeb, 980612
26 .\"
27 .TH ULIMIT 3 2021-03-22 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 ulimit \- get and set user limits
30 .SH SYNOPSIS
31 .nf
32 .B #include <ulimit.h>
33 .PP
34 .BI "long ulimit(int " cmd ", long " newlimit );
35 .fi
36 .SH DESCRIPTION
37 Warning: this routine is obsolete.
38 Use
39 .BR getrlimit (2),
40 .BR setrlimit (2),
41 and
42 .BR sysconf (3)
43 instead.
44 For the shell command
45 .BR ulimit ,
46 see
47 .BR bash (1).
48 .PP
49 The
50 .BR ulimit ()
51 call will get or set some limit for the calling process.
52 The
53 .I cmd
54 argument can have one of the following values.
55 .TP
56 .B UL_GETFSIZE
57 Return the limit on the size of a file, in units of 512 bytes.
58 .TP
59 .B UL_SETFSIZE
60 Set the limit on the size of a file.
61 .TP
62 .B 3
63 (Not implemented for Linux.)
64 Return the maximum possible address of the data segment.
65 .TP
66 .B 4
67 (Implemented but no symbolic constant provided.)
68 Return the maximum number of files that the calling process can open.
69 .SH RETURN VALUE
70 On success,
71 .BR ulimit ()
72 returns a nonnegative value.
73 On error, \-1 is returned, and
74 .I errno
75 is set to indicate the error.
76 .SH ERRORS
77 .TP
78 .B EPERM
79 An unprivileged process tried to increase a limit.
80 .SH ATTRIBUTES
81 For an explanation of the terms used in this section, see
82 .BR attributes (7).
83 .ad l
84 .nh
85 .TS
86 allbox;
87 lbx lb lb
88 l l l.
89 Interface       Attribute       Value
91 .BR ulimit ()
92 T}      Thread safety   MT-Safe
93 .TE
94 .hy
95 .ad
96 .sp 1
97 .SH CONFORMING TO
98 SVr4, POSIX.1-2001.
99 POSIX.1-2008 marks
100 .BR ulimit ()
101 as obsolete.
102 .SH SEE ALSO
103 .BR bash (1),
104 .BR getrlimit (2),
105 .BR setrlimit (2),
106 .BR sysconf (3)