Hide Forgot
This is is in relation to BUG# 4627 The wait call doesn't wake up when a signal is received. We tried to use sigaction but the same thing happens. here is the code we use to test this. #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <sys/errno.h> void static fsigint(s) int s; { printf("signal %d received\n", s); } int main(argc, argv) int argc; char *argv[]; { int pid; int status; printf("Current process id is %d\n", getpid()); pid = fork(); if (pid == 0) { printf("Forked process id is %d\n", getpid()); sleep(1000); exit(0); } signal(SIGINT, fsigint); while(1) { errno = 0; status = 0; printf("ready and waiting...\n"); pid = wait(&status); printf("after wait pid = %d errno = %d\n", pid, errno); } exit(0); }
The test case will not work. Try to use sigaction (or forward the test case you used with sigaction) signal() is unreliable. See bug #4627 for more details. *** This bug has been marked as a duplicate of 4627 ***
Created attachment 80 [details] sigaction test case
the sigaction example pretty much works for me - what exactly are you after?