diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
commit | 420d2ef464d4a741028e132e662d5626806a41f5 (patch) | |
tree | 1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /core/system_helpers.hpp |
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 |