On Sun, Jun 01, 2003 at 09:18:26PM +0100, Lusercop wrote: > > > $SIG{CHLD} = sub { while (waitpid(-1,WNOHANG) > 0 ) { } }; > > If that's all you are doing, then is there anything wrong with > > changing it to this? > > $SIG{CHLD} = 'IGNORE'; > > How is that even remotely the same? In the first case, you end up with no > zombies, in the second case you end up with a load of them?
Hmm, unless I'm missing something, I'm agreeing with Toby. Brief testing on 2.4.20 says that setting SIGCHILD to IGNORE will prevent zombies appearing; I guess it's like vampies and garlic. The man page also indicates that the expected behaviour is that no zombies appear. Given the process ids are sequential in my little test program, it's not Perl doing some daemonlike double-fork(), so I guess some special flag gets set somewhere or something.. dunno ;) I didn't think this behaviour existed either, but it seems to. Try it. Cheers, Alex.