2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
28
29 /*
30 * University Copyright- Copyright (c) 1982, 1986, 1988
31 * The Regents of the University of California
32 * All Rights Reserved
33 *
34 * University Acknowledgment- Portions of this document are derived from
35 * software developed by the University of California, Berkeley, and its
36 * contributors.
37 */
38
39 #ifndef _SYS_RESOURCE_H
40 #define _SYS_RESOURCE_H
41
42 #pragma ident "%Z%%M% %I% %E% SMI"
43
44 #include <sys/feature_tests.h>
45
46 #include <sys/types.h>
47 #include <sys/time.h>
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 /*
54 * Process priority specifications
55 */
56 #define PRIO_PROCESS 0
57 #define PRIO_PGRP 1
58 #define PRIO_USER 2
59 #define PRIO_GROUP 3
60 #define PRIO_SESSION 4
61 #define PRIO_LWP 5
62 #define PRIO_TASK 6
63 #define PRIO_PROJECT 7
241 #define getrlimit getrlimit64
242 #define rlimit rlimit64
243 #endif
244 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
245
246 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
247 /*
248 * In the LP64 compilation environment, map large file interfaces
249 * back to native versions where possible.
250 */
251 #ifdef __PRAGMA_REDEFINE_EXTNAME
252 #pragma redefine_extname setrlimit64 setrlimit
253 #pragma redefine_extname getrlimit64 getrlimit
254 #else
255 #define setrlimit64 setrlimit
256 #define getrlimit64 getrlimit
257 #define rlimit64 rlimit
258 #endif
259 #endif /* _LP64 && _LARGEFILE64_SOURCE */
260
261 #if defined(__STDC__)
262
263 extern int setrlimit(int, const struct rlimit *);
264 extern int getrlimit(int, struct rlimit *);
265
266 /* transitional large file interfaces */
267 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
268 !defined(__PRAGMA_REDEFINE_EXTNAME))
269 extern int setrlimit64(int, const struct rlimit64 *);
270 extern int getrlimit64(int, struct rlimit64 *);
271 #endif /* _LARGEFILE64_SOURCE... */
272
273 extern int getpriority(int, id_t);
274 extern int setpriority(int, id_t, int);
275 extern int getrusage(int, struct rusage *);
276
277 #else /* __STDC__ */
278
279 extern int getrlimit();
280 extern int setrlimit();
281
282 /* transitional large file interfaces */
283 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
284 !defined(__PRAGMA_REDEFINE_EXTNAME))
285 extern int setrlimit64();
286 extern int getrlimit64();
287 #endif /* _LARGEFILE64_SOURCE... */
288
289 extern int getpriority();
290 extern int setpriority();
291 extern int getrusage();
292
293 #endif /* __STDC__ */
294
295 #endif /* _KERNEL */
296
297 #ifdef __cplusplus
298 }
299 #endif
300
301 #endif /* _SYS_RESOURCE_H */
|
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2014 Garrrett D'Amore <garrett@damore.org>
23 *
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 */
27
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
30
31 /*
32 * University Copyright- Copyright (c) 1982, 1986, 1988
33 * The Regents of the University of California
34 * All Rights Reserved
35 *
36 * University Acknowledgment- Portions of this document are derived from
37 * software developed by the University of California, Berkeley, and its
38 * contributors.
39 */
40
41 #ifndef _SYS_RESOURCE_H
42 #define _SYS_RESOURCE_H
43
44 #include <sys/feature_tests.h>
45
46 #include <sys/types.h>
47 #include <sys/time.h>
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 /*
54 * Process priority specifications
55 */
56 #define PRIO_PROCESS 0
57 #define PRIO_PGRP 1
58 #define PRIO_USER 2
59 #define PRIO_GROUP 3
60 #define PRIO_SESSION 4
61 #define PRIO_LWP 5
62 #define PRIO_TASK 6
63 #define PRIO_PROJECT 7
241 #define getrlimit getrlimit64
242 #define rlimit rlimit64
243 #endif
244 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
245
246 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
247 /*
248 * In the LP64 compilation environment, map large file interfaces
249 * back to native versions where possible.
250 */
251 #ifdef __PRAGMA_REDEFINE_EXTNAME
252 #pragma redefine_extname setrlimit64 setrlimit
253 #pragma redefine_extname getrlimit64 getrlimit
254 #else
255 #define setrlimit64 setrlimit
256 #define getrlimit64 getrlimit
257 #define rlimit64 rlimit
258 #endif
259 #endif /* _LP64 && _LARGEFILE64_SOURCE */
260
261 extern int setrlimit(int, const struct rlimit *);
262 extern int getrlimit(int, struct rlimit *);
263
264 /* transitional large file interfaces */
265 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
266 !defined(__PRAGMA_REDEFINE_EXTNAME))
267 extern int setrlimit64(int, const struct rlimit64 *);
268 extern int getrlimit64(int, struct rlimit64 *);
269 #endif /* _LARGEFILE64_SOURCE... */
270
271 extern int getpriority(int, id_t);
272 extern int setpriority(int, id_t, int);
273 extern int getrusage(int, struct rusage *);
274
275 #endif /* _KERNEL */
276
277 #ifdef __cplusplus
278 }
279 #endif
280
281 #endif /* _SYS_RESOURCE_H */
|