1 #ifndef_LINUX_RESOURCE_H 2 #define_LINUX_RESOURCE_H 3
4 /* 5 * Resource control/accounting header file for linux 6 */ 7
8 /* 9 * Definition of struct rusage taken from BSD 4.3 Reno 10 * 11 * We don't support all of these yet, but we might as well have them.... 12 * Otherwise, each time we add new items, programs which depend on this 13 * structure will lose. This reduces the chances of that happening. 14 */ 15 #defineRUSAGE_SELF 0
16 #defineRUSAGE_CHILDREN (-1)
17 #defineRUSAGE_BOTH (-2) /* sys_wait4() uses this */ 18
19 structrusage{ 20 structtimevalru_utime; /* user time used */ 21 structtimevalru_stime; /* system time used */ 22 long ru_maxrss; /* maximum resident set size */ 23 long ru_ixrss; /* integral shared memory size */ 24 long ru_idrss; /* integral unshared data size */ 25 long ru_isrss; /* integral unshared stack size */ 26 longru_minflt; /* page reclaims */ 27 longru_majflt; /* page faults */ 28 long ru_nswap; /* swaps */ 29 long ru_inblock; /* block input operations */ 30 long ru_oublock; /* block output operations */ 31 long ru_msgsnd; /* messages sent */ 32 long ru_msgrcv; /* messages received */ 33 long ru_nsignals; /* signals received */ 34 long ru_nvcsw; /* voluntary context switches */ 35 long ru_nivcsw; /* involuntary " */ 36 };
37
38 /* 39 * Resource limits 40 */ 41
42 #define RLIMIT_CPU 0 /* CPU time in ms */ 43 #defineRLIMIT_FSIZE 1 /* Maximum filesize */ 44 #defineRLIMIT_DATA 2 /* max data size */ 45 #defineRLIMIT_STACK 3 /* max stack size */ 46 #defineRLIMIT_CORE 4 /* max core file size */ 47 #defineRLIMIT_RSS 5 /* max resident set size */ 48
49 #ifdef notdef
50 #define RLIMIT_MEMLOCK 6 /* max locked-in-memory address space*/ 51 #define RLIMIT_NPROC 7 /* max number of processes */ 52 #define RLIMIT_OFILE 8 /* max number of open files */ 53 #endif 54
55 #defineRLIM_NLIMITS 6
56
57 #defineRLIM_INFINITY 0x7FFFFFFF
58
59 structrlimit{ 60 intrlim_cur;
61 intrlim_max;
62 };
63
64 #define PRIO_MIN (-99)
65 #define PRIO_MAX 14
66
67 #definePRIO_PROCESS 0
68 #definePRIO_PGRP 1
69 #definePRIO_USER 2
70
71 #endif