Questions tagged [setrlimit]

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: , , , , .

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 bytes
  • RLIMIT_CPU - maximum amount of CPU time, in seconds, used by a process
  • RLIMIT_DATA - maximum size of a process' data segment, in bytes
  • RLIMIT_FSIZE - maximum size of a file, in bytes, that may be created by a process
  • RLIMIT_NOFILE - a number one greater than the maximum value that the system may assign to a newly-created file descriptor
  • RLIMIT_STACK - maximum size of the initial thread's stack, in bytes
  • RLIMIT_AS - maximum size of a process' total available memory, in bytes

Other systems like BSD or Linux may allow setting of additional limits.

61 questions
0
votes
1 answer

Increasing stack space with setrlimit() on a multi-threaded application with split stacks

I'm thinking of developing my own work-stealing scheduler, and one of the issues that needs to be solved is the possibility of stack overflows. These occur only on infrequent cases where one worker continuously steals tasks from the others…
João Rafael
  • 131
  • 1
  • 7
1 2 3 4
5