RLIMITSTACK
RLIMITSTACK (RLIMIT_STACK in POSIX) is a resource limit that defines the maximum size of a thread’s stack. It is part of the suite of RLIMIT resources used to control a process’s memory usage and is accessed through system interfaces such as getrlimit and setrlimit.
The stack for a thread grows downward as the thread allocates stack frames. The limit restricts how
Setting and querying the limit are done with the rlimit structure and the functions getrlimit and setrlimit.
Default values for RLIMIT_STACK vary by operating system and architecture. On many Linux systems, the main thread