
David Brown wrote:
Both [waitForProcess and getProcessExitCode] will throw an exception if the process terminated on a signal.
So if I terminate a process manually, I'll have to wait for the ExitCode to avoid a zombie process, and waiting for the ExitCode invariably throws an exception.
It's just the way that Unix process management works. I guess you have to catch the exception to handle it well. This is part of the aspect that makes writing shells so complicated.
I think that Peter was referring primarily to the fact that the
Haskell interface to waitpid() throws an exception if the process
terminated due to a signal, not the fact that you have to "reap"
children to prevent the accumulation of zombies.
The C interface is that waitpid() (and similar) return a status code;
you can then use the macros from