Re: waitid() function replacement
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Eric _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Apr 5, 2006, at 17:35 , Kevin Harris wrote: Here's my situation: My program spawns processes and needs to be able to signal (for termination purposes, if they don't quit on their own) the process as well as any other process it has started (within the same process group). It is not possible to use waitpid() on the process (or process group), if the process has quit, as it will then become unsafe to send a term or kill signal to that process group. This is because of a potential race condition where another process may have started with the same PID. The PID cannot be reused until your parent process gives a chance to the OS to reap the zombie. On most Unix-derived OSes you should be able to set your SIGCHLD handling in such a way that the children will remain zombies until wait() or waitpid() is used. This removes the race condition you are concerned about. This email sent to site_archiver@lists.apple.com
participants (1)
-
Eric Gouriou