^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _UAPI_ASM_GENERIC_RESOURCE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _UAPI_ASM_GENERIC_RESOURCE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Resource limit IDs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * ( Compatibility detail: there are architectures that have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * a different rlimit ID order in the 5-9 range and want
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * to keep that order for binary compatibility. The reasons
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * are historic and all new rlimits are identical across all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * arches. If an arch has such special order for some rlimits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * then it defines them prior including asm-generic/resource.h. )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define RLIMIT_CPU 0 /* CPU time in sec */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define RLIMIT_FSIZE 1 /* Maximum filesize */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define RLIMIT_DATA 2 /* max data size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define RLIMIT_STACK 3 /* max stack size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define RLIMIT_CORE 4 /* max core file size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #ifndef RLIMIT_RSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) # define RLIMIT_RSS 5 /* max resident set size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #ifndef RLIMIT_NPROC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) # define RLIMIT_NPROC 6 /* max number of processes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #ifndef RLIMIT_NOFILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) # define RLIMIT_NOFILE 7 /* max number of open files */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #ifndef RLIMIT_MEMLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) # define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #ifndef RLIMIT_AS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) # define RLIMIT_AS 9 /* address space limit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define RLIMIT_LOCKS 10 /* maximum file locks held */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define RLIMIT_SIGPENDING 11 /* max number of pending signals */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define RLIMIT_NICE 13 /* max nice prio allowed to raise to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 0-39 for nice level 19 .. -20 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define RLIMIT_RTPRIO 14 /* maximum realtime priority */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define RLIMIT_RTTIME 15 /* timeout for RT tasks in us */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #define RLIM_NLIMITS 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * SuS says limits have to be unsigned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * Which makes a ton more sense anyway.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * Some architectures override this (for compatibility reasons):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #ifndef RLIM_INFINITY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) # define RLIM_INFINITY (~0UL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #endif /* _UAPI_ASM_GENERIC_RESOURCE_H */