1 #ifndef _LINUX_RESOURCE_H
2 #define _LINUX_RESOURCE_H
4 #include <linux/time.h>
7 * Resource control/accounting header file for linux
11 * Definition of struct rusage taken from BSD 4.3 Reno
13 * We don't support all of these yet, but we might as well have them....
14 * Otherwise, each time we add new items, programs which depend on this
15 * structure will lose. This reduces the chances of that happening.
18 #define RUSAGE_CHILDREN (-1)
19 #define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
20 #define RUSAGE_THREAD 1 /* only the calling thread */
23 struct timeval ru_utime; /* user time used */
24 struct timeval ru_stime; /* system time used */
25 long ru_maxrss; /* maximum resident set size */
26 long ru_ixrss; /* integral shared memory size */
27 long ru_idrss; /* integral unshared data size */
28 long ru_isrss; /* integral unshared stack size */
29 long ru_minflt; /* page reclaims */
30 long ru_majflt; /* page faults */
31 long ru_nswap; /* swaps */
32 long ru_inblock; /* block input operations */
33 long ru_oublock; /* block output operations */
34 long ru_msgsnd; /* messages sent */
35 long ru_msgrcv; /* messages received */
36 long ru_nsignals; /* signals received */
37 long ru_nvcsw; /* voluntary context switches */
38 long ru_nivcsw; /* involuntary " */
42 unsigned long rlim_cur;
43 unsigned long rlim_max;
46 #define PRIO_MIN (-20)
49 #define PRIO_PROCESS 0
54 * Limit the stack by to some sane default: root can always
55 * increase this limit if needed.. 8MB seems reasonable.
57 #define _STK_LIM (8*1024*1024)
60 * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
61 * and other sensitive information are never written to disk.
63 #define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
66 * Due to binary compatibility, the actual resource numbers
67 * may be different for different linux versions..
69 #include <asm/resource.h>
75 int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
76 int do_setrlimit(struct task_struct *tsk, unsigned int resource,
77 struct rlimit *new_rlim);
79 #endif /* __KERNEL__ */