Update.
[glibc.git] / sysdeps / unix / sysv / linux / s390 / s390-64 / bits / resource.h
blob1df6871813633f0025ea325cd25f57b39e899b1d
1 /* Bit values & structures for resource limits. 64 bit S/390 version.
2 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #ifndef _SYS_RESOURCE_H
21 # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
22 #endif
24 #include <bits/types.h>
26 /* Transmute defines to enumerations. The macro re-definitions are
27 necessary because some programs want to test for operating system
28 features with #ifdef RUSAGE_SELF. In ISO C the reflexive
29 definition is a no-op. */
31 /* Kinds of resource limit. */
32 enum __rlimit_resource
34 /* Per-process CPU limit, in seconds. */
35 RLIMIT_CPU = 0,
36 #define RLIMIT_CPU RLIMIT_CPU
38 /* Largest file that can be created, in bytes. */
39 RLIMIT_FSIZE = 1,
40 #define RLIMIT_FSIZE RLIMIT_FSIZE
42 /* Maximum size of data segment, in bytes. */
43 RLIMIT_DATA = 2,
44 #define RLIMIT_DATA RLIMIT_DATA
46 /* Maximum size of stack segment, in bytes. */
47 RLIMIT_STACK = 3,
48 #define RLIMIT_STACK RLIMIT_STACK
50 /* Largest core file that can be created, in bytes. */
51 RLIMIT_CORE = 4,
52 #define RLIMIT_CORE RLIMIT_CORE
54 /* Largest resident set size, in bytes.
55 This affects swapping; processes that are exceeding their
56 resident set size will be more likely to have physical memory
57 taken from them. */
58 RLIMIT_RSS = 5,
59 #define RLIMIT_RSS RLIMIT_RSS
61 /* Number of processes. */
62 RLIMIT_NPROC = 6,
63 #define RLIMIT_NPROC RLIMIT_NPROC
65 /* Number of open files. */
66 RLIMIT_NOFILE = 7,
67 RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */
68 #define RLIMIT_NOFILE RLIMIT_NOFILE
69 #define RLIMIT_OFILE RLIMIT_OFILE
71 /* Locked-in-memory address space. */
72 RLIMIT_MEMLOCK = 8,
73 #define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
75 /* Address space limit (?) */
76 RLIMIT_AS = 9,
77 #define RLIMIT_AS RLIMIT_AS
79 /* Maximum number of file locks. */
80 RLIMIT_LOCKS = 10,
81 #define RLIMIT_LOCKS RLIMIT_LOCKS
83 RLIMIT_NLIMITS = 11,
84 RLIM_NLIMITS = RLIMIT_NLIMITS
85 #define RLIMIT_NLIMITS RLIMIT_NLIMITS
86 #define RLIM_NLIMITS RLIM_NLIMITS
89 /* Value to indicate that there is no limit. */
90 # define RLIM_INFINITY ~0UL
92 #ifdef __USE_LARGEFILE64
93 # define RLIM64_INFINITY ~0UL
94 #endif
96 /* We can represent all limits. */
97 #define RLIM_SAVED_MAX RLIM_INFINITY
98 #define RLIM_SAVED_CUR RLIM_INFINITY
101 /* Type for resource quantity measurement. */
102 typedef __rlim64_t rlim_t;
103 #ifdef __USE_LARGEFILE64
104 typedef __rlim64_t rlim64_t;
105 #endif
107 struct rlimit
109 /* The current (soft) limit. */
110 rlim_t rlim_cur;
111 /* The hard limit. */
112 rlim_t rlim_max;
115 #ifdef __USE_LARGEFILE64
116 struct rlimit64
118 /* The current (soft) limit. */
119 rlim64_t rlim_cur;
120 /* The hard limit. */
121 rlim64_t rlim_max;
123 #endif
125 /* Whose usage statistics do you want? */
126 enum __rusage_who
128 /* The calling process. */
129 RUSAGE_SELF = 0,
130 #define RUSAGE_SELF RUSAGE_SELF
132 /* All of its terminated child processes. */
133 RUSAGE_CHILDREN = -1,
134 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
136 /* Both. */
137 RUSAGE_BOTH = -2
138 #define RUSAGE_BOTH RUSAGE_BOTH
141 #define __need_timeval
142 #include <bits/time.h> /* For `struct timeval'. */
144 /* Structure which says how much of each resource has been used. */
145 struct rusage
147 /* Total amount of user time used. */
148 struct timeval ru_utime;
149 /* Total amount of system time used. */
150 struct timeval ru_stime;
151 /* Maximum resident set size (in kilobytes). */
152 long int ru_maxrss;
153 /* Amount of sharing of text segment memory
154 with other processes (kilobyte-seconds). */
155 long int ru_ixrss;
156 /* Amount of data segment memory used (kilobyte-seconds). */
157 long int ru_idrss;
158 /* Amount of stack memory used (kilobyte-seconds). */
159 long int ru_isrss;
160 /* Number of soft page faults (i.e. those serviced by reclaiming
161 a page from the list of pages awaiting reallocation. */
162 long int ru_minflt;
163 /* Number of hard page faults (i.e. those that required I/O). */
164 long int ru_majflt;
165 /* Number of times a process was swapped out of physical memory. */
166 long int ru_nswap;
167 /* Number of input operations via the file system. Note: This
168 and `ru_oublock' do not include operations with the cache. */
169 long int ru_inblock;
170 /* Number of output operations via the file system. */
171 long int ru_oublock;
172 /* Number of IPC messages sent. */
173 long int ru_msgsnd;
174 /* Number of IPC messages received. */
175 long int ru_msgrcv;
176 /* Number of signals delivered. */
177 long int ru_nsignals;
178 /* Number of voluntary context switches, i.e. because the process
179 gave up the process before it had to (usually to wait for some
180 resource to be available). */
181 long int ru_nvcsw;
182 /* Number of involuntary context switches, i.e. a higher priority process
183 became runnable or the current process used up its time slice. */
184 long int ru_nivcsw;
187 /* Priority limits. */
188 #define PRIO_MIN -20 /* Minimum priority a process can have. */
189 #define PRIO_MAX 20 /* Maximum priority a process can have. */
191 /* The type of the WHICH argument to `getpriority' and `setpriority',
192 indicating what flavor of entity the WHO argument specifies. */
193 enum __priority_which
195 PRIO_PROCESS = 0, /* WHO is a process ID. */
196 #define PRIO_PROCESS PRIO_PROCESS
197 PRIO_PGRP = 1, /* WHO is a process group ID. */
198 #define PRIO_PGRP PRIO_PGRP
199 PRIO_USER = 2 /* WHO is a user ID. */
200 #define PRIO_USER PRIO_USER