This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-generic / resource.h
1 #ifndef _ASM_GENERIC_RESOURCE_H
2 #define _ASM_GENERIC_RESOURCE_H
3
4 /*
5  * Resource limits
6  */
7
8 /* Allow arch to control resource order */
9 #ifndef __ARCH_RLIMIT_ORDER
10 #define RLIMIT_CPU              0       /* CPU time in ms */
11 #define RLIMIT_FSIZE            1       /* Maximum filesize */
12 #define RLIMIT_DATA             2       /* max data size */
13 #define RLIMIT_STACK            3       /* max stack size */
14 #define RLIMIT_CORE             4       /* max core file size */
15 #define RLIMIT_RSS              5       /* max resident set size */
16 #define RLIMIT_NPROC            6       /* max number of processes */
17 #define RLIMIT_NOFILE           7       /* max number of open files */
18 #define RLIMIT_MEMLOCK          8       /* max locked-in-memory address space */
19 #define RLIMIT_AS               9       /* address space limit */
20 #define RLIMIT_LOCKS            10      /* maximum file locks held */
21 #define RLIMIT_SIGPENDING       11      /* max number of pending signals */
22 #define RLIMIT_MSGQUEUE         12      /* maximum bytes in POSIX mqueues */
23
24 #define RLIM_NLIMITS            13
25 #endif
26
27 /*
28  * SuS says limits have to be unsigned.
29  * Which makes a ton more sense anyway.
30  */
31 #ifndef RLIM_INFINITY
32 #define RLIM_INFINITY   (~0UL)
33 #endif
34
35 #ifndef _STK_LIM_MAX
36 #define _STK_LIM_MAX    RLIM_INFINITY
37 #endif
38
39 #ifdef __KERNEL__
40
41 #define INIT_RLIMITS                                                    \
42 {                                                                       \
43         [RLIMIT_CPU]            = { RLIM_INFINITY, RLIM_INFINITY },     \
44         [RLIMIT_FSIZE]          = { RLIM_INFINITY, RLIM_INFINITY },     \
45         [RLIMIT_DATA]           = { RLIM_INFINITY, RLIM_INFINITY },     \
46         [RLIMIT_STACK]          = {      _STK_LIM, _STK_LIM_MAX  },     \
47         [RLIMIT_CORE]           = {             0, RLIM_INFINITY },     \
48         [RLIMIT_RSS]            = { RLIM_INFINITY, RLIM_INFINITY },     \
49         [RLIMIT_NPROC]          = {             0,             0 },     \
50         [RLIMIT_NOFILE]         = {      INR_OPEN,     INR_OPEN  },     \
51         [RLIMIT_MEMLOCK]        = {   MLOCK_LIMIT,   MLOCK_LIMIT },     \
52         [RLIMIT_AS]             = { RLIM_INFINITY, RLIM_INFINITY },     \
53         [RLIMIT_LOCKS]          = { RLIM_INFINITY, RLIM_INFINITY },     \
54         [RLIMIT_SIGPENDING]     = { MAX_SIGPENDING, MAX_SIGPENDING },   \
55         [RLIMIT_MSGQUEUE]       = { MQ_BYTES_MAX, MQ_BYTES_MAX },       \
56 }
57
58 #endif  /* __KERNEL__ */
59
60 #endif