1: /*
2: * Copyright (c) 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)resource.h 1.3 (2.11BSD GTE) 1997/2/14
7: */
8:
9: #ifndef _SYS_RESOURCE_H_
10: #define _SYS_RESOURCE_H_
11:
12: /*
13: * Process priority specifications to get/setpriority.
14: */
15: #define PRIO_MIN -20
16: #define PRIO_MAX 20
17:
18: #define PRIO_PROCESS 0
19: #define PRIO_PGRP 1
20: #define PRIO_USER 2
21:
22: /*
23: * Resource utilization information.
24: */
25:
26: #define RUSAGE_SELF 0
27: #define RUSAGE_CHILDREN -1
28:
29: struct rusage {
30: struct timeval ru_utime; /* user time used */
31: struct timeval ru_stime; /* system time used */
32: long ru_maxrss;
33: #define ru_first ru_ixrss
34: long ru_ixrss; /* integral shared memory size */
35: long ru_idrss; /* integral unshared data " */
36: long ru_isrss; /* integral unshared stack " */
37: long ru_minflt; /* page reclaims */
38: long ru_majflt; /* page faults */
39: long ru_ovly; /* overlay changes */
40: long ru_nswap; /* swaps */
41: long ru_inblock; /* block input operations */
42: long ru_oublock; /* block output operations */
43: long ru_msgsnd; /* messages sent */
44: long ru_msgrcv; /* messages received */
45: long ru_nsignals; /* signals received */
46: long ru_nvcsw; /* voluntary context switches */
47: long ru_nivcsw; /* involuntary " */
48: #define ru_last ru_nivcsw
49: };
50:
51: struct k_rusage { /* KERNEL RUSAGE STRUCTURE */
52: #define k_ru_first ru_utime
53: long ru_utime; /* user time used ('hz' ticks) */
54: long ru_stime; /* system time used ('hz' ticks) */
55: long ru_ovly; /* overlay changes */
56: long ru_nswap; /* swaps */
57: long ru_inblock; /* block input operations */
58: long ru_oublock; /* block output operations */
59: long ru_msgsnd; /* messages sent */
60: long ru_msgrcv; /* messages received */
61: long ru_nsignals; /* signals received */
62: long ru_nvcsw; /* voluntary context switches */
63: long ru_nivcsw; /* involuntary " */
64: #define k_ru_last ru_nivcsw
65: };
66:
67: /*
68: * Resource limits
69: */
70: #define RLIMIT_CPU 0 /* cpu time in milliseconds */
71: #define RLIMIT_FSIZE 1 /* maximum file size */
72: #define RLIMIT_DATA 2 /* data size */
73: #define RLIMIT_STACK 3 /* stack size */
74: #define RLIMIT_CORE 4 /* core file size */
75: #define 5 /* resident set size */
76:
77: #define RLIM_NLIMITS 6 /* number of resource limits */
78:
79: #define RLIM_INFINITY 0x7fffffff
80:
81: struct rlimit {
82: long rlim_cur; /* current (soft) limit */
83: long rlim_max; /* maximum value for rlim_cur */
84: };
85:
86: /* Load average structure. */
87: struct loadavg {
88: short ldavg[3];
89: int fscale;
90: };
91: #endif /* !_SYS_RESOURCE_H_ */
Defined struct's
rlimit
defined in line
81; used 40 times
rusage
defined in line
29; used 76 times
- in /usr/src/bin/csh/sh.h line
67(2)
- in /usr/src/bin/csh/sh.proc.c line
38(2),
634(2),
662-663(4)
- in /usr/src/bin/csh/sh.time.c line
19(2),
34(2),
61(2),
78(2)
- in /usr/src/bin/tcsh/sh.h line
342(2)
- in /usr/src/bin/tcsh/sh.proc.c line
113(2),
123-125(4),
176(2),
1126-1127(4)
- in /usr/src/bin/tcsh/sh.time.c line
75(2),
106(2),
165(2),
253(2)
- in /usr/src/bin/time.c line
21(2)
- in /usr/src/lib/libc/compat-4.1/times.c line
19(2)
- in /usr/src/lib/libc/gen/wait.c line
47(2)
- in /usr/src/lib/libc/gen/wait3.c line
47(2)
- in /usr/src/lib/libc/gen/waitpid.c line
49(2)
- in /usr/src/new/nntp/server/serve.c line
88(2)
- in /usr/src/new/nntp/xmit/nntpxmit.c line
290(2)
- in /usr/src/sys/sys/kern_exit.c line
163(2),
190(2)
- in /usr/src/sys/sys/kern_resource.c line
213-216(4),
234(2),
256(2)
- in /usr/src/ucb/PORT/pascal/px/utilities.c line
20(2)
- in /usr/src/ucb/window/lcmd2.c line
63(2)
- in /usr/src/usr.sbin/inetd/inetd.c line
472(2)
- in /usr/src/usr.sbin/named/named/ns_main.c line
944(2)
- in /usr/src/usr.sbin/syslogd/syslogd.c line
716(2)
Defined macros
RLIMIT_CPU
defined in line
70; used 32 times
- in /usr/src/bin/chpass/chpass.c line
135
- in /usr/src/bin/csh/sh.func.c line
878,
954-959(2),
966,
972,
980,
986,
1026
- in /usr/src/bin/passwd/passwd.c line
83
- in /usr/src/bin/tcsh/sh.func.c line
1252-1253(2),
1408-1410(2),
1419,
1425,
1435,
1441-1442(2),
1450-1451(2),
1461,
1508-1509(2)
- in /usr/src/bin/tcsh/sh.print.c line
58
- in /usr/src/sys/sys/kern_clock.c line
106-110(4)
- in /usr/src/sys/sys/kern_resource.c line
163,
194
- in /usr/src/usr.sbin/vipw/vipw.c line
55
defined in line
75; used 3 times
RLIM_INFINITY
defined in line
79; used 27 times
- in /usr/src/bin/chpass/chpass.c line
134
- in /usr/src/bin/csh/sh.func.c line
994,
1024,
1047,
1055,
1070,
1076
- in /usr/src/bin/passwd/passwd.c line
82
- in /usr/src/bin/tcsh/sh.func.c line
1227,
1459,
1506,
1541,
1549,
1567,
1574-1579(2)
- in /usr/src/sys/sys/init_main.c line
86
- in /usr/src/sys/sys/kern_exit.c line
76
- in /usr/src/sys/sys/kern_resource.c line
168-173(4),
198-200(2)
- in /usr/src/usr.sbin/pstat/pstat.c line
659,
668
- in /usr/src/usr.sbin/vipw/vipw.c line
54
Usage of this include