summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 29a6bd132..7c76674e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -32,6 +32,11 @@
#include "datafiles.h"
#include "modules.h"
+// getrlimit.
+#include <sys/time.h>
+#include <sys/resource.h>
+
+
/******** Global variables! ********/
/* Command-line options: (note that configuration variables are in config.c) */
@@ -409,6 +414,25 @@ int main(int ac, char **av, char **envp)
started = 1;
+#ifndef _WIN32
+ if (DumpCore)
+ {
+ rlimit rl;
+ if (getrlimit(RLIMIT_CORE, &rl) == -1)
+ {
+ alog("Failed to getrlimit()!");
+ }
+ else
+ {
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_CORE, &rl) == -1)
+ {
+ alog("setrlimit() failed, cannot increase coredump size");
+ }
+ }
+ }
+#endif
+
/*** Main loop. ***/
while (!quitting) {