xref: /titanic_51/usr/src/lib/libbc/inc/include/sys/resource.h (revision 6bbe05905a1c10a2703f95fb4912eb14b87f6670)
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 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #ifndef _sys_resource_h
30 #define _sys_resource_h
31 
32 /*
33  * Process priority specifications to get/setpriority.
34  */
35 #define	PRIO_MIN	-20
36 #define	PRIO_MAX	20
37 
38 #define	PRIO_PROCESS	0
39 #define	PRIO_PGRP	1
40 #define	PRIO_USER	2
41 
42 /*
43  * Resource utilization information.
44  */
45 
46 #define	RUSAGE_SELF	0
47 #define	RUSAGE_CHILDREN	-1
48 
49 struct	rusage {
50 	struct timeval ru_utime;	/* user time used */
51 	struct timeval ru_stime;	/* system time used */
52 	long	ru_maxrss;
53 #define	ru_first	ru_ixrss
54 	long	ru_ixrss;		/* XXX: 0 */
55 	long	ru_idrss;		/* XXX: sum of rm_asrss */
56 	long	ru_isrss;		/* XXX: 0 */
57 	long	ru_minflt;		/* any page faults not requiring I/O */
58 	long	ru_majflt;		/* any page faults requiring I/O */
59 	long	ru_nswap;		/* swaps */
60 	long	ru_inblock;		/* block input operations */
61 	long	ru_oublock;		/* block output operations */
62 	long	ru_msgsnd;		/* messages sent */
63 	long	ru_msgrcv;		/* messages received */
64 	long	ru_nsignals;		/* signals received */
65 	long	ru_nvcsw;		/* voluntary context switches */
66 	long	ru_nivcsw;		/* involuntary " */
67 #define	ru_last		ru_nivcsw
68 };
69 
70 /*
71  * Resource limits
72  */
73 #define	RLIMIT_CPU	0		/* cpu time in milliseconds */
74 #define	RLIMIT_FSIZE	1		/* maximum file size */
75 #define	RLIMIT_DATA	2		/* data size */
76 #define	RLIMIT_STACK	3		/* stack size */
77 #define	RLIMIT_CORE	4		/* core file size */
78 #define	RLIMIT_RSS	5		/* resident set size */
79 #define	RLIMIT_NOFILE	6		/* maximum descriptor index + 1 */
80 
81 #define	RLIM_NLIMITS	7		/* number of resource limits */
82 
83 #define	RLIM_INFINITY	0x7fffffff
84 
85 struct rlimit {
86 	int	rlim_cur;		/* current (soft) limit */
87 	int	rlim_max;		/* maximum value for rlim_cur */
88 };
89 
90 #endif /*!_sys_resource_h*/
91