Home | History | Annotate | Download | only in test
      1 /* This is simply a process that segfaults */
      2 #include <stdlib.h>
      3 #include <signal.h>
      4 
      5 #include <sys/time.h>
      6 #include <sys/resource.h>
      7 
      8 int
      9 main (int argc, char **argv)
     10 {
     11   char *p;
     12 
     13   struct rlimit r = { 0, };
     14 
     15   getrlimit (RLIMIT_CORE, &r);
     16   r.rlim_cur = 0;
     17   setrlimit (RLIMIT_CORE, &r);
     18 
     19   raise (SIGSEGV);
     20 
     21   p = NULL;
     22   *p = 'a';
     23 
     24   return 0;
     25 }
     26