forking and zombies in SYSV.

Bob Lenk rml at hpfcdc.HP.COM
Fri Aug 24 09:11:07 AEST 1990


Several people have suggested

	signal(SIGCLD, SIG_IGN);

While this does prevent zombies from being formed in System III, System
V, and compatible systems, there are some reasons to avoid it:

	1) Portability.  This does not work in all implementations
	   (notably not in BSD).  It is not required by POSIX, XPG,
	   or even the SVID.  

	2) Possible side-effects.  This can impact any part of your
	   program that creates children, including library calls that
	   might create children for reasons unknown to you.  It can
	   impact the programs exec'd by descendents if they create
	   children.  Most code that creates children expects to wait
	   for them.  This can cause such code to hang (until all your
	   children have died) and/or to get unexpected errors (possibly
	   missing out on important status information).

It is generally worth waiting for child processes in some way.

		Bob Lenk
		rml at fc.hp.com
		{uunet,hplabs}!fc.hp.com!rml



More information about the Comp.unix.wizards mailing list