system call included in POSIX which allows setting of limits on operating system resources like CPU, memory, files and possibly others
setrlimit()
is a system call included in POSIX which allows setting of operating system limits on resources like CPU, memory, files and possibly others. The corresponding system call for reading the limits is getrlimit()
. Related tags are: limit, ulimit, syscall, unix, posix.
This system call was present on System V and BSD Unixes. Later it was adopted into POSIX.1. It is also present on Linux and other Unix-like systems.
POSIX.1 (IEEE Std 1003.1) setrlimit()
specifies setting of these limits:
RLIMIT_CORE
- maximum size of a core file, in bytesRLIMIT_CPU
- maximum amount of CPU time, in seconds, used by a processRLIMIT_DATA
- maximum size of a process' data segment, in bytesRLIMIT_FSIZE
- maximum size of a file, in bytes, that may be created by a processRLIMIT_NOFILE
- a number one greater than the maximum value that the system may assign to a newly-created file descriptorRLIMIT_STACK
- maximum size of the initial thread's stack, in bytesRLIMIT_AS
- maximum size of a process' total available memory, in bytes
Other systems like BSD or Linux may allow setting of additional limits.