[Haskell-cafe] exitFailure under forkProcess

John Goerzen jgoerzen at complete.org
Tue Oct 26 17:29:21 EDT 2004


I'm having a little weird situation here.

Whenever I call exitFailure under forkProcess, I get:

(progname): forkProcess: uncaught exception

Test program:

import System.Exit
import System.Posix.Process
main = forkProcess exitFailure

If you remove the forkProcess call, the program properly silently exits
with exit code 1.

I have no idea why it is displaying this message to stderr when called
under forkProcess.  I argue that it shouldn't.  It is perfectly valid to
return with an error code from a child process, and absolutely necessary
in some cases when your later waitpid() call needs to know what
happened.  (Or, in Haskell, getProcessStatus()).


More information about the Haskell-Cafe mailing list