* dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and WIN_ONLY comma...
[platform/upstream/dbus.git] / test / test-segfault.c
1 /* This is simply a process that segfaults */
2 #include <config.h>
3 #include <stdlib.h>
4 #include <signal.h>
5
6 #ifdef HAVE_SETRLIMIT
7 #include <sys/resource.h>
8 #endif
9
10 int
11 main (int argc, char **argv)
12 {
13   char *p;  
14
15 #if HAVE_SETRLIMIT
16   struct rlimit r = { 0, };
17   
18   getrlimit (RLIMIT_CORE, &r);
19   r.rlim_cur = 0;
20   setrlimit (RLIMIT_CORE, &r);
21   
22   raise (SIGSEGV);
23 #endif
24   p = NULL;
25   *p = 'a';
26   
27   return 0;
28 }