os/ossrv/ofdbus/dbus/tsrc/testapps/dbus_test_cases/test-segfault.c
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /* Portion Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.*/
     2 /* This is simply a process that segfaults */
     3 #include <stdlib.h>
     4 #ifndef TODO
     5 #include <signal.h>
     6 #endif
     7 #include <sys/time.h>
     8 #include <sys/resource.h>
     9 
    10 int
    11 main ()
    12 {
    13   char *p;  
    14 
    15   struct rlimit r = { 0, };
    16   #ifndef TODO
    17   getrlimit (RLIMIT_CORE, &r);
    18   r.rlim_cur = 0;
    19   setrlimit (RLIMIT_CORE, &r);
    20   
    21    raise (SIGSEGV);
    22   #endif
    23   p = NULL;
    24   *p = 'a';
    25   
    26   return 0;
    27 }