Back to index

glibc  2.9
tst-exit2.c
Go to the documentation of this file.
00001 #include <pthread.h>
00002 #include <signal.h>
00003 #include <stdio.h>
00004 #include <string.h>
00005 #include <unistd.h>
00006 
00007 
00008 static void *
00009 tf (void *arg)
00010 {
00011   while (1)
00012     sleep (100);
00013 
00014   /* NOTREACHED */
00015   return NULL;
00016 }
00017 
00018 
00019 static int
00020 do_test (void)
00021 {
00022   pthread_t th;
00023 
00024   int e = pthread_create (&th, NULL, tf, NULL);
00025   if (e != 0)
00026     {
00027       printf ("create failed: %s\n", strerror (e));
00028       return 1;
00029     }
00030 
00031   /* Terminate only this thread.  */
00032   pthread_exit (NULL);
00033 
00034   /* NOTREACHED */
00035   return 1;
00036 }
00037 
00038 #define EXPECTED_SIGNAL SIGALRM
00039 #define TEST_FUNCTION do_test ()
00040 #include "../test-skeleton.c"