1 #include <stdlib.h> 2 #include <pthread.h> 3 #include <unistd.h> 4 #include <stdio.h> 5 #include <signal.h> t_fn(void * v)6static void* t_fn(void* v) 7 { 8 sigset_t mask; 9 10 sigfillset(&mask); 11 sigsuspend(&mask); 12 return NULL; 13 } 14 main(int argc,char * argv[])15int main (int argc, char *argv[]) 16 { 17 pthread_t t1; 18 19 pthread_create(&t1, NULL, t_fn, NULL); 20 21 sleep(1); // Should be enough to have the thread in sigsuspend 22 // printf("dying\n"); 23 exit(0); 24 } 25