1

Linux system() after setting SA_NOCLDWAIT to SIGCHLD

view story
linux-howto

http://stackoverflow.com – The man page of system() states that "During execution of the command, SIGCHLD will be blocked" In my code I'm installing a handler for SIGCHLD that writes something to the log and ignores the signal. I do this to know about children that exited in my log and avoid zombie processes. A problem occurs when I use the system() call. With this handler in place system() always returns -1 and not the child's exit code. But according the to the above quote from the man page, system() is supposed to handle the signals from the child. What am I doing wrong? My code is as follows: static void handleS (HowTos)