tst-exit2.c 579 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include <pthread.h>
  2. #include <signal.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <unistd.h>
  6. static void *
  7. tf (void *arg)
  8. {
  9. while (1)
  10. sleep (100);
  11. /* NOTREACHED */
  12. return NULL;
  13. }
  14. static int
  15. do_test (void)
  16. {
  17. pthread_t th;
  18. int e = pthread_create (&th, NULL, tf, NULL);
  19. if (e != 0)
  20. {
  21. printf ("create failed: %s\n", strerror (e));
  22. return 1;
  23. }
  24. /* Terminate only this thread. */
  25. pthread_exit (NULL);
  26. /* NOTREACHED */
  27. return 1;
  28. }
  29. #define EXPECTED_SIGNAL SIGALRM
  30. #define TEST_FUNCTION do_test ()
  31. #include "../test-skeleton.c"