On 2004-10-26, Peter Simons <[EMAIL PROTECTED]> wrote:
> What will happen if I call getProcessExitCode for the same
> process twice? Will that block? Cause an error? Or return
> the same child's exit code again?

Assuming it is based on wait() or one of its derivatives, and I suspect
it is, you cannot call it more than once for a single process.  Once you
have wait()ed for a process, the data about its termination is no longer
tracked by the kernel, so you can no longer retrieve it.

A Zomebie process is precisely one that is dead but has not yet been
waited upon.  They exist so that they can be waited upon.

It should be pretty easy to install a SIGCHLD handler that reaps
children whenever one dies.  Such code is found all over the place in C.
(And Python, and Perl, and...  well everywhere except Java, probably.)

-- 
John Goerzen
Author, Foundations of Python Network Programming
http://www.amazon.com/exec/obidos/tg/detail/-/1590593715

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to