"Anselm R Garbe" <[EMAIL PROTECTED]> writes: > Well, I remember there was a problem with the SIGCHLD signal handler, > I need to recheck with Stevens tomorrow. It might be that this was on > some ancient UNIX though. But the double-fork is definately the most > portable solution.
Page 267 in Stevens. I can't recall ever working with a UNIX where SIGCHLD wasn't sent, process control in such an environment would be next to impossible. Maybe the older code was doing this: signal(SIGCHLD, SIG_IGN) which is a trick of POSIX.1-2001 to not create zombies. If you'd tried this (which would have worked on Linux, I think), it would have piled up zombies on anything not conformant to that standard. If you have a Linux box, this is in the NOTES section of the sigaction(2) man page. I assert that my SIGCHLD solution is just as portable as the double-fork, and is more appropriate, since the double-fork is usually only done in daemons. In fact, the only reason reparenting to init (with the double-fork) works is because init calls wait() in its SIGCHLD handler :) Neale