OSDN Git Service

a2abb381f97875e5275e4599aa310de2c307cb37
[linuxjm/LDP_man-pages.git] / original / man3 / ulimit.3
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 2008-08-06 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 ulimit \- get and set user limits
30 .SH SYNOPSIS
31 .B #include <ulimit.h>
32 .sp
33 .BI "long ulimit(int " cmd ", long " newlimit );
34 .SH DESCRIPTION
35 Warning: This routine is obsolete.
36 Use
37 .BR getrlimit (2),
38 .BR setrlimit (2),
39 and
40 .BR sysconf (3)
41 instead.
42 For the shell command
43 .BR ulimit (),
44 see
45 .BR bash (1).
46
47 The
48 .BR ulimit ()
49 call will get or set some limit for the calling process.
50 The
51 .I cmd
52 argument can have one of the following values.
53 .TP
54 .B UL_GETFSIZE
55 Return the limit on the size of a file, in units of 512 bytes.
56 .TP
57 .B UL_SETFSIZE
58 Set the limit on the size of a file.
59 .TP
60 .B 3
61 (Not implemented for Linux.)
62 Return the maximum possible address of the data segment.
63 .TP
64 .B 4
65 (Implemented but no symbolic constant provided.)
66 Return the maximum number of files that the calling process can open.
67 .SH RETURN VALUE
68 On success,
69 .BR ulimit ()
70 returns a nonnegative value.
71 On error, \-1 is returned, and
72 .I errno
73 is set appropriately.
74 .SH ERRORS
75 .TP
76 .B EPERM
77 A unprivileged process tried to increase a limit.
78 .SH CONFORMING TO
79 SVr4, POSIX.1-2001.
80 POSIX.1-2008 marks
81 .BR ulimit ()
82 as obsolete.
83 .SH SEE ALSO
84 .BR bash (1),
85 .BR getrlimit (2),
86 .BR setrlimit (2),
87 .BR sysconf (3)
88 .SH COLOPHON
89 This page is part of release 3.67 of the Linux
90 .I man-pages
91 project.
92 A description of the project,
93 information about reporting bugs,
94 and the latest version of this page,
95 can be found at
96 \%http://www.kernel.org/doc/man\-pages/.