October 2017
Intermediate to advanced
354 pages
9h 28m
English
The kernel imposes resource limits to ensure fair allocation of system resources among contending processes. These limits guarantee that a random process does not monopolize ownership of resources. There are 16 different types of resource limits, and the task structure points to an array of type struct rlimit, in which each offset holds the current and maximum values for a specific resource.
/*include/uapi/linux/resource.h*/struct rlimit { __kernel_ulong_t rlim_cur; __kernel_ulong_t rlim_max;};These limits are specified in include/uapi/asm-generic/resource.h #define RLIMIT_CPU 0 /* CPU time in sec */ #define RLIMIT_FSIZE 1 /* Maximum filesize */ #define RLIMIT_DATA 2 /* max data size */ #define RLIMIT_STACK 3 ...