]>
Commit | Line | Data |
---|---|---|
28f540f4 | 1 | /* Bit values for resource limits. SunOS 4 version. |
1fb05e3d | 2 | Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. |
54d79e99 | 3 | This file is part of the GNU C Library. |
28f540f4 | 4 | |
54d79e99 UD |
5 | The GNU C Library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public License as | |
7 | published by the Free Software Foundation; either version 2 of the | |
8 | License, or (at your option) any later version. | |
28f540f4 | 9 | |
54d79e99 UD |
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 | Library General Public License for more details. | |
28f540f4 | 14 | |
54d79e99 UD |
15 | You should have received a copy of the GNU Library General Public |
16 | License along with the GNU C Library; see the file COPYING.LIB. If not, | |
17 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
18 | Boston, MA 02111-1307, USA. */ | |
28f540f4 RM |
19 | |
20 | /* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a | |
21 | subset of these kinds of resource limit. In systems where `getrlimit' | |
22 | and `setrlimit' are not system calls, these are the values used by the C | |
23 | library to emulate them. */ | |
24 | ||
25 | /* Kinds of resource limit. */ | |
26 | enum __rlimit_resource | |
27 | { | |
28 | /* Per-process CPU limit, in seconds. */ | |
29 | RLIMIT_CPU, | |
23396375 | 30 | #define RLIMIT_CPU RLIMIT_CPU |
28f540f4 RM |
31 | /* Largest file that can be created, in bytes. */ |
32 | RLIMIT_FSIZE, | |
23396375 | 33 | #define RLIMIT_FSIZE RLIMIT_FSIZE |
28f540f4 RM |
34 | /* Maximum size of data segment, in bytes. */ |
35 | RLIMIT_DATA, | |
23396375 | 36 | #define RLIMIT_DATA RLIMIT_DATA |
28f540f4 RM |
37 | /* Maximum size of stack segment, in bytes. */ |
38 | RLIMIT_STACK, | |
23396375 | 39 | #define RLIMIT_STACK RLIMIT_STACK |
28f540f4 RM |
40 | /* Largest core file that can be created, in bytes. */ |
41 | RLIMIT_CORE, | |
23396375 | 42 | #define RLIMIT_CORE RLIMIT_CORE |
28f540f4 RM |
43 | /* Largest resident set size, in bytes. |
44 | This affects swapping; processes that are exceeding their | |
45 | resident set size will be more likely to have physical memory | |
46 | taken from them. */ | |
47 | RLIMIT_RSS, | |
23396375 | 48 | #define RLIMIT_RSS RLIMIT_RSS |
28f540f4 RM |
49 | /* Number of open files. */ |
50 | RLIMIT_NOFILE, | |
51 | RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ | |
1fb05e3d UD |
52 | #define RLIMIT_NOFILE RLIMIT_NOFILE |
53 | #define RLIMIT_OFILE RLIMIT_OFILE | |
28f540f4 | 54 | |
ba1ffaa1 UD |
55 | RLIM_NLIMITS, |
56 | ||
57 | RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */ | |
58 | #define RLIM_INFINITY RLIM_INFINITY | |
59 | }; | |
60 | ||
61 | struct rlimit | |
62 | { | |
63 | /* The current (soft) limit. */ | |
64 | int rlim_cur; | |
65 | /* The hard limit. */ | |
66 | int rlim_max; | |
67 | }; | |
68 | ||
69 | /* Whose usage statistics do you want? */ | |
70 | enum __rusage_who | |
71 | /* The macro definitions are necessary because some programs want | |
72 | to test for operating system features with #ifdef RUSAGE_SELF. | |
73 | In ISO C the reflexive definition is a no-op. */ | |
74 | { | |
75 | /* The calling process. */ | |
76 | RUSAGE_SELF = 0, | |
77 | #define RUSAGE_SELF RUSAGE_SELF | |
78 | /* All of its terminated child processes. */ | |
79 | RUSAGE_CHILDREN = -1 | |
80 | #define RUSAGE_CHILDREN RUSAGE_CHILDREN | |
81 | }; | |
82 | ||
83 | #include <sys/time.h> /* For `struct timeval'. */ | |
84 | ||
85 | /* Structure which says how much of each resource has been used. */ | |
86 | struct rusage | |
87 | { | |
88 | /* Total amount of user time used. */ | |
89 | struct timeval ru_utime; | |
90 | /* Total amount of system time used. */ | |
91 | struct timeval ru_stime; | |
92 | /* Maximum resident set size (in kilobytes). */ | |
93 | long int ru_maxrss; | |
94 | /* Amount of sharing of text segment memory | |
95 | with other processes (kilobyte-seconds). */ | |
96 | long int ru_ixrss; | |
97 | /* Amount of data segment memory used (kilobyte-seconds). */ | |
98 | long int ru_idrss; | |
99 | /* Amount of stack memory used (kilobyte-seconds). */ | |
100 | long int ru_isrss; | |
101 | /* Number of soft page faults (i.e. those serviced by reclaiming | |
102 | a page from the list of pages awaiting reallocation. */ | |
103 | long int ru_minflt; | |
104 | /* Number of hard page faults (i.e. those that required I/O). */ | |
105 | long int ru_majflt; | |
106 | /* Number of times a process was swapped out of physical memory. */ | |
107 | long int ru_nswap; | |
108 | /* Number of input operations via the file system. Note: This | |
109 | and `ru_oublock' do not include operations with the cache. */ | |
110 | long int ru_inblock; | |
111 | /* Number of output operations via the file system. */ | |
112 | long int ru_oublock; | |
113 | /* Number of IPC messages sent. */ | |
114 | long int ru_msgsnd; | |
115 | /* Number of IPC messages received. */ | |
116 | long int ru_msgrcv; | |
117 | /* Number of signals delivered. */ | |
118 | long int ru_nsignals; | |
119 | /* Number of voluntary context switches, i.e. because the process | |
120 | gave up the process before it had to (usually to wait for some | |
121 | resource to be available). */ | |
122 | long int ru_nvcsw; | |
123 | /* Number of involuntary context switches, i.e. a higher priority process | |
124 | became runnable or the current process used up its time slice. */ | |
125 | long int ru_nivcsw; | |
126 | }; | |
127 | ||
128 | /* Priority limits. */ | |
129 | #define PRIO_MIN -20 /* Minimum priority a process can have. */ | |
130 | #define PRIO_MAX 20 /* Maximum priority a process can have. */ | |
131 | ||
132 | /* The type of the WHICH argument to `getpriority' and `setpriority', | |
133 | indicating what flavor of entity the WHO argument specifies. */ | |
134 | enum __priority_which | |
135 | { | |
136 | PRIO_PROCESS = 0, /* WHO is a process ID. */ | |
137 | PRIO_PGRP = 1, /* WHO is a process group ID. */ | |
138 | PRIO_USER = 2 /* WHO is a user ID. */ | |
28f540f4 | 139 | }; |