| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
/* |
|
2
|
|
|
|
|
|
|
* Copyright (c) 1995-2003 Jarkko Hietaniemi. All rights reserved. |
|
3
|
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or |
|
4
|
|
|
|
|
|
|
* modify it under the same terms as Perl itself. |
|
5
|
|
|
|
|
|
|
* |
|
6
|
|
|
|
|
|
|
* Resource.xs |
|
7
|
|
|
|
|
|
|
* |
|
8
|
|
|
|
|
|
|
*/ |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#include "EXTERN.h" |
|
11
|
|
|
|
|
|
|
#include "perl.h" |
|
12
|
|
|
|
|
|
|
#include "XSUB.h" |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 4)) |
|
15
|
|
|
|
|
|
|
#define PL_sv_undef sv_undef |
|
16
|
|
|
|
|
|
|
#define PL_sv_yes sv_yes |
|
17
|
|
|
|
|
|
|
#endif |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#if defined(__hpux) && !defined(_INCLUDE_XOPEN_SOURCE_EXTENDED) |
|
20
|
|
|
|
|
|
|
#define _INCLUDE_XOPEN_SOURCE_EXTENDED |
|
21
|
|
|
|
|
|
|
#endif |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
/* if this fails your vendor has failed you and Perl cannot help. */ |
|
24
|
|
|
|
|
|
|
#include <sys/resource.h> |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
/* Some old Solarises have no RUSAGE_* defined in <sys/resource.h>. |
|
32
|
|
|
|
|
|
|
* There is <sys/rusage.h> which has but this file is very non-standard. |
|
33
|
|
|
|
|
|
|
* More the fun, the file itself warns will not be there for long. */ |
|
34
|
|
|
|
|
|
|
# define part_of_sec tv_nsec |
|
35
|
|
|
|
|
|
|
# endif |
|
36
|
|
|
|
|
|
|
/* Solaris uses timerstruc_t in struct rusage. According to the <sys/time.h> |
|
37
|
|
|
|
|
|
|
* in old Solarises tv_nsec in the timerstruc_t is nanoseconds (and the name |
|
38
|
|
|
|
|
|
|
* also supports that theory) BUT getrusage() seems after all to tick |
|
39
|
|
|
|
|
|
|
* microseconds, not nano. */ |
|
40
|
|
|
|
|
|
|
# define part_in_sec 0.000001 |
|
41
|
|
|
|
|
|
|
# |
|
42
|
|
|
|
|
|
|
/* Newer Solarises (5.5 onwards) have much better support for rusage-kinda |
|
43
|
|
|
|
|
|
|
* things via the proc interface. */ |
|
44
|
|
|
|
|
|
|
# define _STRUCTURED_PROC 1 |
|
45
|
|
|
|
|
|
|
# include <sys/procfs.h> |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
/* there is getrusage() in HPUX but only as an indirect syscall */ |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
/* some rlimits exist (but are officially unsupported by HP) */ |
|
99
|
|
|
|
|
|
|
# define RLIMIT_CPU 0 |
|
100
|
|
|
|
|
|
|
# define RLIMIT_FSIZE 1 |
|
101
|
|
|
|
|
|
|
# define RLIMIT_DATA 2 |
|
102
|
|
|
|
|
|
|
# define RLIMIT_STACK 3 |
|
103
|
|
|
|
|
|
|
# define RLIMIT_CORE 4 |
|
104
|
|
|
|
|
|
|
# define RLIMIT_RSS 5 |
|
105
|
|
|
|
|
|
|
# define RLIMIT_NOFILE 6 |
|
106
|
|
|
|
|
|
|
# define RLIMIT_OPEN_MAX RLIMIT_NOFILE |
|
107
|
|
|
|
|
|
|
# define RLIM_NLIMITS 7 |
|
108
|
|
|
|
|
|
|
# define RLIM_INFINITY 0x7fffffff |
|
109
|
|
|
|
|
|
|
#endif |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
#ifdef __linux__ |
|
112
|
|
|
|
|
|
|
/* enums without |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
static int |
|
203
|
|
|
|
|
|
|
not_here(s) |
|
204
|
|
|
|
|
|
|
char *s; |
|
205
|
|
|
|
|
|
|
{ |
|
206
|
|
|
|
|
|
|
croak("BSD::Resource::%s not implemented on this architecture", s); |
|
207
|
|
|
|
|
|
|
return -1; |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
static double |
|
211
|
|
|
|
|
|
|
constant(name, arg) |
|
212
|
|
|
|
|
|
|
char *name; |
|
213
|
|
|
|
|
|
|
int arg; |
|
214
|
|
|
|
|
|
|
{ |
|
215
|
48
|
|
|
|
|
|
errno = 0; |
|
216
|
48
|
|
|
|
|
|
switch (*name) { |
|
217
|
|
|
|
|
|
|
case 'E': |
|
218
|
14
|
|
|
|
|
|
if (strEQ(name, "EINVAL")) |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
return EINVAL; |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
goto not_there; |
|
223
|
|
|
|
|
|
|
|
|
224
|
7
|
|
|
|
|
|
if (strEQ(name, "ENOENT")) |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
return ENOENT; |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
goto not_there; |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
break; |
|
231
|
|
|
|
|
|
|
case 'P': |
|
232
|
2
|
|
|
|
|
|
if (strnEQ(name, "PRIO_", 5)) { |
|
233
|
2
|
|
|
|
|
|
if (strEQ(name, "PRIO_MIN")) |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
return PRIO_MIN; |
|
236
|
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
goto not_there; |
|
238
|
|
|
|
|
|
|
|
|
239
|
2
|
|
|
|
|
|
if (strEQ(name, "PRIO_MAX")) |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
return PRIO_MAX; |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
goto not_there; |
|
244
|
|
|
|
|
|
|
|
|
245
|
2
|
|
|
|
|
|
if (strEQ(name, "PRIO_USER")) |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
return PRIO_USER; |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
goto not_there; |
|
250
|
|
|
|
|
|
|
|
|
251
|
2
|
|
|
|
|
|
if (strEQ(name, "PRIO_PGRP")) |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
return PRIO_PGRP; |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
goto not_there; |
|
256
|
|
|
|
|
|
|
|
|
257
|
2
|
|
|
|
|
|
if (strEQ(name, "PRIO_PROCESS")) |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
return PRIO_PROCESS; |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
goto not_there; |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
} |
|
264
|
|
|
|
|
|
|
goto not_there; |
|
265
|
|
|
|
|
|
|
case 'R': |
|
266
|
32
|
|
|
|
|
|
if (strnEQ(name, "RLIM", 4)) { |
|
267
|
29
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_AIO_MEM")) |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
return RLIMIT_AIO_MEM; |
|
270
|
|
|
|
|
|
|
|
|
271
|
29
|
|
|
|
|
|
goto not_there; |
|
272
|
|
|
|
|
|
|
|
|
273
|
29
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_AIO_OPS")) |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
return RLIMIT_AIO_OPS; |
|
276
|
|
|
|
|
|
|
|
|
277
|
29
|
|
|
|
|
|
goto not_there; |
|
278
|
|
|
|
|
|
|
|
|
279
|
29
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_AS")) |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
return RLIMIT_AS; |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
goto not_there; |
|
284
|
|
|
|
|
|
|
|
|
285
|
27
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_CORE")) |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
return RLIMIT_CORE; |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
goto not_there; |
|
290
|
|
|
|
|
|
|
|
|
291
|
25
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_CPU")) |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
return RLIMIT_CPU; |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
goto not_there; |
|
296
|
|
|
|
|
|
|
|
|
297
|
23
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_DATA")) |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
return RLIMIT_DATA; |
|
300
|
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
goto not_there; |
|
302
|
|
|
|
|
|
|
|
|
303
|
21
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_FSIZE")) |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
return RLIMIT_FSIZE; |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
goto not_there; |
|
308
|
|
|
|
|
|
|
|
|
309
|
19
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_LOCKS")) |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
return RLIMIT_LOCKS; |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
goto not_there; |
|
314
|
|
|
|
|
|
|
|
|
315
|
17
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_MEMLOCK")) |
|
316
|
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
return RLIMIT_MEMLOCK; |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
goto not_there; |
|
320
|
|
|
|
|
|
|
|
|
321
|
15
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_NOFILE")) |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
return RLIMIT_NOFILE; |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
goto not_there; |
|
326
|
|
|
|
|
|
|
|
|
327
|
13
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_NPROC")) |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
return RLIMIT_NPROC; |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
goto not_there; |
|
332
|
|
|
|
|
|
|
|
|
333
|
11
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_OFILE")) |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
return RLIMIT_OFILE; |
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
goto not_there; |
|
338
|
|
|
|
|
|
|
|
|
339
|
9
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_OPEN_MAX")) |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
return RLIMIT_OPEN_MAX; |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
goto not_there; |
|
344
|
|
|
|
|
|
|
|
|
345
|
7
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_RSS")) |
|
346
|
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
return RLIMIT_RSS; |
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
goto not_there; |
|
350
|
|
|
|
|
|
|
|
|
351
|
5
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_STACK")) |
|
352
|
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
return RLIMIT_STACK; |
|
354
|
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
goto not_there; |
|
356
|
|
|
|
|
|
|
|
|
357
|
3
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_TCACHE")) |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
return RLIMIT_TCACHE; |
|
360
|
|
|
|
|
|
|
|
|
361
|
3
|
|
|
|
|
|
goto not_there; |
|
362
|
|
|
|
|
|
|
|
|
363
|
3
|
|
|
|
|
|
if (strEQ(name, "RLIMIT_VMEM")) |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
return RLIMIT_VMEM; |
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
goto not_there; |
|
368
|
|
|
|
|
|
|
|
|
369
|
1
|
|
|
|
|
|
if (strEQ(name, "RLIM_INFINITY")) |
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
return -1.0; /* trust me */ |
|
372
|
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
goto not_there; |
|
374
|
|
|
|
|
|
|
|
|
375
|
0
|
|
|
|
|
|
if (strEQ(name, "RLIM_NLIMITS")) |
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
return RLIM_NLIMITS; |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
goto not_there; |
|
380
|
|
|
|
|
|
|
|
|
381
|
0
|
|
|
|
|
|
if (strEQ(name, "RLIM_SAVED_CUR")) |
|
382
|
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
return RLIM_SAVED_CUR; |
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
goto not_there; |
|
386
|
|
|
|
|
|
|
|
|
387
|
0
|
|
|
|
|
|
if (strEQ(name, "RLIM_SAVED_MAX")) |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
return RLIM_SAVED_MAX; |
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
goto not_there; |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
break; |
|
394
|
|
|
|
|
|
|
} |
|
395
|
3
|
|
|
|
|
|
if (strnEQ(name, "RUSAGE_", 7)) { |
|
396
|
3
|
|
|
|
|
|
if (strEQ(name, "RUSAGE_BOTH")) |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
return RUSAGE_BOTH; |
|
399
|
|
|
|
|
|
|
|
|
400
|
3
|
|
|
|
|
|
goto not_there; |
|
401
|
|
|
|
|
|
|
|
|
402
|
3
|
|
|
|
|
|
if (strEQ(name, "RUSAGE_CHILDREN")) |
|
403
|
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
return RUSAGE_CHILDREN; |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
goto not_there; |
|
407
|
|
|
|
|
|
|
|
|
408
|
2
|
|
|
|
|
|
if (strEQ(name, "RUSAGE_SELF")) |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
return RUSAGE_SELF; |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
goto not_there; |
|
413
|
|
|
|
|
|
|
|
|
414
|
0
|
|
|
|
|
|
if (strEQ(name, "RUSAGE_THREAD")) |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
return RUSAGE_THREAD; |
|
417
|
|
|
|
|
|
|
|
|
418
|
7
|
|
|
|
|
|
goto not_there; |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
break; |
|
421
|
|
|
|
|
|
|
} |
|
422
|
|
|
|
|
|
|
} |
|
423
|
|
|
|
|
|
|
|
|
424
|
7
|
|
|
|
|
|
errno = EINVAL; |
|
425
|
|
|
|
|
|
|
return |