Messages in this thread | | | Date | Tue, 24 Nov 1998 07:09:13 +0100 (MET) | From | (Guest section DW) | Subject | RE: Possible bug in wait4(), 2.1.126-129 ? |
| |
The following program
#include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <signal.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h>
int main(int argc, char *argv[]) { int pid; struct sigaction act;
sigaction(SIGCHLD, NULL, &act); act.sa_handler = SIG_IGN; sigaction(SIGCHLD, &act, NULL);
pid = fork();
if (pid == 0) { fprintf(stderr, "\nnobody waits for me?\n"); } else if (pid != -1) { sleep(3); if (waitpid(pid, NULL, 0) == -1) perror("waitpid"); }
exit(0); }
demonstrates the behaviour of a reported ECHILD without the need for cron. Now it is immediately clear what the problem is. Note that POSIX explicitly disallows setting the action of SIGCHLD to SIG_IGN. It follows that crond and atd are not POSIX compliant.
Andries
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |