xref: /titanic_41/usr/src/ucbhead/sys/resource.h (revision 62c3776affc53153ce74e14a6e7ce91950c28102)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1997 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #ifndef _SYS_RESOURCE_H
41 #define	_SYS_RESOURCE_H
42 
43 #pragma ident	"%Z%%M%	%I%	%E% SMI"
44 
45 #ifndef _SYS_RUSAGE_H
46 #include <sys/rusage.h>
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /*
54  * Process priority specifications to get/setpriority.
55  */
56 #define	PRIO_MIN	-20
57 #define	PRIO_MAX	20
58 
59 #define	PRIO_PROCESS	0
60 #define	PRIO_PGRP	1
61 #define	PRIO_USER	2
62 
63 /*
64  * Resource limits
65  * RLIMIT_RSS removed so RLIMIT_NOFILE takes the value of 5
66  * to stay compatible with svr4
67  */
68 #define	RLIMIT_CPU	0		/* cpu time in milliseconds */
69 #define	RLIMIT_FSIZE	1		/* maximum file size */
70 #define	RLIMIT_DATA	2		/* data size */
71 #define	RLIMIT_STACK	3		/* stack size */
72 #define	RLIMIT_CORE	4		/* core file size */
73 #define	RLIMIT_NOFILE	5		/* maximum descriptor index + 1 */
74 
75 #define	RLIM_NLIMITS	7		/* number of resource limits */
76 
77 #define	RLIM_INFINITY	0x7fffffff
78 
79 struct rlimit {
80 	int	rlim_cur;		/* current (soft) limit */
81 	int	rlim_max;		/* maximum value for rlim_cur */
82 };
83 
84 #if defined(__STDC__)
85 extern int getpriority(int, int);
86 extern int setpriority(int, int, int);
87 extern int setrlimit(int, const struct rlimit *);
88 extern int getrlimit(int, struct rlimit *);
89 #else
90 extern int getpriority();
91 extern int setpriority();
92 extern int setrlimit();
93 extern int getrlimit();
94 #endif
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* !_SYS_RESOURCE_H */
101