5 #include <sys/signal.h>
10 #ifdef __ARCH_USE_MMU__
12 static void test_handler(int signo)
14 write(1, "caught SIGCHLD\n", 15);
21 struct sigaction siga;
24 /* Set up sighandling */
26 siga.sa_handler = test_handler;
29 if (sigaction(SIGCHLD, &siga, (struct sigaction *)NULL) != 0) {
30 fprintf(stderr, "sigaction choked: %s!", strerror(errno));
34 /* Setup a child process to exercise the sig handling for us */
39 for (i=0; i < 3; i++) {
47 /* Wait for signals */
48 write(1, "waiting for a SIGCHLD\n",22);
51 if (waitpid(-1, NULL, WNOHANG | WUNTRACED) > 0)
53 write(1, "after sleep\n", 12);
56 printf("Bye-bye! All done!\n");
64 printf("Skipping test on non-mmu host!\n");