aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/start_up.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/start_up.c')
-rw-r--r--arch/um/os-Linux/start_up.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 5178eba9afa5..1244179e6c83 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -17,6 +17,7 @@
17#include <sys/time.h> 17#include <sys/time.h>
18#include <sys/wait.h> 18#include <sys/wait.h>
19#include <sys/mman.h> 19#include <sys/mman.h>
20#include <sys/resource.h>
20#include <asm/unistd.h> 21#include <asm/unistd.h>
21#include <asm/page.h> 22#include <asm/page.h>
22#include <sys/types.h> 23#include <sys/types.h>
@@ -329,8 +330,32 @@ static void __init check_ptrace(void)
329 330
330extern void check_tmpexec(void); 331extern void check_tmpexec(void);
331 332
333static void check_coredump_limit(void)
334{
335 struct rlimit lim;
336 int err = getrlimit(RLIMIT_CORE, &lim);
337
338 if(err){
339 perror("Getting core dump limit");
340 return;
341 }
342
343 printf("Core dump limits :\n\tsoft - ");
344 if(lim.rlim_cur == RLIM_INFINITY)
345 printf("NONE\n");
346 else printf("%lu\n", lim.rlim_cur);
347
348 printf("\thard - ");
349 if(lim.rlim_max == RLIM_INFINITY)
350 printf("NONE\n");
351 else printf("%lu\n", lim.rlim_max);
352}
353
332void os_early_checks(void) 354void os_early_checks(void)
333{ 355{
356 /* Print out the core dump limits early */
357 check_coredump_limit();
358
334 check_ptrace(); 359 check_ptrace();
335 360
336 /* Need to check this early because mmapping happens before the 361 /* Need to check this early because mmapping happens before the