]> granicus.if.org Git - icinga2/commitdiff
Set stack size rlimit.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 14 Feb 2014 09:44:09 +0000 (10:44 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 14 Feb 2014 09:44:28 +0000 (10:44 +0100)
Fixes #5659

lib/base/application.cpp

index 2d956a3ee2c951aade291e37e1c0ec4eea47c5f9..cb04a3b6febb966753a87cbfcfadf5ae08225247 100644 (file)
@@ -136,6 +136,14 @@ void Application::SetResourceLimits(void)
        Log(LogDebug, "base", "System does not support adjusting the resource limit for number of processes (RLIMIT_NPROC)");
 #      endif /* RLIMIT_NPROC */
 #endif /* _WIN32 */
+
+#      ifdef RLIMIT_STACK
+       rl.rlim_cur = 128 * 1024;
+       rl.rlim_max = rl.rlim_cur;
+
+       if (setrlimit(RLIMIT_STACK, &rl) < 0)
+               Log(LogDebug, "base", "Could not adjust resource limit for stack size (RLIMIT_STACK)");
+#      endif /* RLIMIT_STACK */
 }
 
 int Application::GetArgC(void)