BSD 4_3_Tahoe release
[unix-history] / usr / src / sys / h / resource.h
CommitLineData
da7c5cc6 1/*
1810611d 2 * Copyright (c) 1982, 1986 Regents of the University of California.
da7c5cc6
KM
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
95f51977 6 * @(#)resource.h 7.1 (Berkeley) 6/4/86
da7c5cc6 7 */
d3a04260
SL
8
9/*
10 * Process priority specifications to get/setpriority.
11 */
12#define PRIO_MIN -20
13#define PRIO_MAX 20
14
15#define PRIO_PROCESS 0
16#define PRIO_PGRP 1
17#define PRIO_USER 2
18
19/*
20 * Resource utilization information.
21 */
22
23#define RUSAGE_SELF 0
24#define RUSAGE_CHILDREN -1
25
26struct rusage {
27 struct timeval ru_utime; /* user time used */
28 struct timeval ru_stime; /* system time used */
59703a43 29 long ru_maxrss;
d3a04260
SL
30#define ru_first ru_ixrss
31 long ru_ixrss; /* integral shared memory size */
32 long ru_idrss; /* integral unshared data " */
33 long ru_isrss; /* integral unshared stack " */
34 long ru_minflt; /* page reclaims */
35 long ru_majflt; /* page faults */
36 long ru_nswap; /* swaps */
37 long ru_inblock; /* block input operations */
38 long ru_oublock; /* block output operations */
39 long ru_msgsnd; /* messages sent */
40 long ru_msgrcv; /* messages received */
41 long ru_nsignals; /* signals received */
42 long ru_nvcsw; /* voluntary context switches */
43 long ru_nivcsw; /* involuntary " */
44#define ru_last ru_nivcsw
45};
46
47/*
48 * Resource limits
49 */
50#define RLIMIT_CPU 0 /* cpu time in milliseconds */
51#define RLIMIT_FSIZE 1 /* maximum file size */
52#define RLIMIT_DATA 2 /* data size */
53#define RLIMIT_STACK 3 /* stack size */
54#define RLIMIT_CORE 4 /* core file size */
55#define RLIMIT_RSS 5 /* resident set size */
56
57#define RLIM_NLIMITS 6 /* number of resource limits */
58
59#define RLIM_INFINITY 0x7fffffff
60
61struct rlimit {
62 int rlim_cur; /* current (soft) limit */
63 int rlim_max; /* maximum value for rlim_cur */
64};