diff options
Diffstat (limited to 'core/system_helpers.hpp')
-rw-r--r-- | core/system_helpers.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/system_helpers.hpp b/core/system_helpers.hpp new file mode 100644 index 0000000..75e0d1d --- /dev/null +++ b/core/system_helpers.hpp @@ -0,0 +1,15 @@ +#ifndef AWHaeL8KnNSHrAOreOTeQZXxBG8 +#define AWHaeL8KnNSHrAOreOTeQZXxBG8 + +#include <sys/resource.h> + +void garantueeStackSize(rlim_t size) { + struct rlimit rl; + assert(getrlimit(RLIMIT_STACK, &rl) == 0); + if (rl.rlim_cur < size) { + rl.rlim_cur = size; + assert(setrlimit(RLIMIT_STACK, &rl) == 0); + } +} + +#endif // AWHaeL8KnNSHrAOreOTeQZXxBG8 |