1<sys/resource.h>(0P) POSIX Programmer's Manual <sys/resource.h>(0P)
2
3
4
6 sys/resource.h - definitions for XSI resource operations
7
9 #include <sys/resource.h>
10
12 The <sys/resource.h> header shall define the following symbolic con‐
13 stants as possible values of the which argument of getpriority() and
14 setpriority():
15
16 PRIO_PROCESS
17 Identifies the who argument as a process ID.
18
19 PRIO_PGRP
20 Identifies the who argument as a process group ID.
21
22 PRIO_USER
23 Identifies the who argument as a user ID.
24
25
26 The following type shall be defined through typedef:
27
28 rlim_t Unsigned integer type used for limit values.
29
30
31 The following symbolic constants shall be defined:
32
33 RLIM_INFINITY
34 A value of rlim_t indicating no limit.
35
36 RLIM_SAVED_MAX
37 A value of type rlim_t indicating an unrepresentable saved hard
38 limit.
39
40 RLIM_SAVED_CUR
41 A value of type rlim_t indicating an unrepresentable saved soft
42 limit.
43
44
45 On implementations where all resource limits are representable in an
46 object of type rlim_t, RLIM_SAVED_MAX and RLIM_SAVED_CUR need not be
47 distinct from RLIM_INFINITY.
48
49 The following symbolic constants shall be defined as possible values of
50 the who parameter of getrusage():
51
52 RUSAGE_SELF
53 Returns information about the current process.
54
55 RUSAGE_CHILDREN
56 Returns information about children of the current process.
57
58
59 The <sys/resource.h> header shall define the rlimit structure that
60 includes at least the following members:
61
62
63 rlim_t rlim_cur The current (soft) limit.
64 rlim_t rlim_max The hard limit.
65
66 The <sys/resource.h> header shall define the rusage structure that
67 includes at least the following members:
68
69
70 struct timeval ru_utime User time used.
71 struct timeval ru_stime System time used.
72
73 The timeval structure shall be defined as described in <sys/time.h> .
74
75 The following symbolic constants shall be defined as possible values
76 for the resource argument of getrlimit() and setrlimit():
77
78 RLIMIT_CORE
79 Limit on size of core file.
80
81 RLIMIT_CPU
82 Limit on CPU time per process.
83
84 RLIMIT_DATA
85 Limit on data segment size.
86
87 RLIMIT_FSIZE
88 Limit on file size.
89
90 RLIMIT_NOFILE
91 Limit on number of open files.
92
93 RLIMIT_STACK
94 Limit on stack size.
95
96 RLIMIT_AS
97 Limit on address space size.
98
99
100 The following shall be declared as functions and may also be defined as
101 macros. Function prototypes shall be provided.
102
103
104 int getpriority(int, id_t);
105 int getrlimit(int, struct rlimit *);
106 int getrusage(int, struct rusage *);
107 int setpriority(int, id_t, int);
108 int setrlimit(int, const struct rlimit *);
109
110 The id_t type shall be defined through typedef as described in
111 <sys/types.h> .
112
113 Inclusion of the <sys/resource.h> header may also make visible all sym‐
114 bols from <sys/time.h>.
115
116 The following sections are informative.
117
119 None.
120
122 None.
123
125 None.
126
128 <sys/time.h>, <sys/types.h>, the System Interfaces volume of
129 IEEE Std 1003.1-2001, getpriority(), getrusage(), getrlimit()
130
132 Portions of this text are reprinted and reproduced in electronic form
133 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
134 -- Portable Operating System Interface (POSIX), The Open Group Base
135 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
136 Electrical and Electronics Engineers, Inc and The Open Group. In the
137 event of any discrepancy between this version and the original IEEE and
138 The Open Group Standard, the original IEEE and The Open Group Standard
139 is the referee document. The original Standard can be obtained online
140 at http://www.opengroup.org/unix/online.html .
141
142
143
144IEEE/The Open Group 2003 <sys/resource.h>(0P)