Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d94cda04eb82feb87c932ac3d4aef1e9dc78a43
Commit:     1d94cda04eb82feb87c932ac3d4aef1e9dc78a43
Parent:     48b201846901c1780fbc7ea779dcc8aa8ab8e16b
Author:     Jeff Dike <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:51:00 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:13:00 2007 -0700

    uml: print coredump limits
    
    Print out core dump limits at boot time.  This is to allow core dumps
    to be collected if something goes very wrong and to tell if a core
    dump isn't going to happen because of a resource limit.
    
    Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>
    Cc: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/um/os-Linux/start_up.c |   25 +++++++++++++++++++++++++
 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 5178eba..1244179 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -17,6 +17,7 @@
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
+#include <sys/resource.h>
 #include <asm/unistd.h>
 #include <asm/page.h>
 #include <sys/types.h>
@@ -329,8 +330,32 @@ static void __init check_ptrace(void)
 
 extern void check_tmpexec(void);
 
+static void check_coredump_limit(void)
+{
+       struct rlimit lim;
+       int err = getrlimit(RLIMIT_CORE, &lim);
+
+       if(err){
+               perror("Getting core dump limit");
+               return;
+       }
+
+       printf("Core dump limits :\n\tsoft - ");
+       if(lim.rlim_cur == RLIM_INFINITY)
+               printf("NONE\n");
+       else printf("%lu\n", lim.rlim_cur);
+
+       printf("\thard - ");
+       if(lim.rlim_max == RLIM_INFINITY)
+               printf("NONE\n");
+       else printf("%lu\n", lim.rlim_max);
+}
+
 void os_early_checks(void)
 {
+       /* Print out the core dump limits early */
+       check_coredump_limit();
+
        check_ptrace();
 
        /* Need to check this early because mmapping happens before the
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to