
26 Oct
2004
26 Oct
'04
6:06 p.m.
John Goerzen writes:
(progname): forkProcess: uncaught exception
Quoting from the documentation: forkProcess :: IO () -> IO ProcessID [...] On success, forkProcess returns the child's ProcessID to the parent process; in case of an error, an exception is thrown. What I assume is happening is this: The child terminates _right away_, with a non-success error code, no less. And my guess is that forkProcess interprets this as the /fork/ having failed and throws an exception. The following program, for example, works fine:
import System.Exit import System.Posix.Process import Control.Concurrent main = forkProcess (threadDelay (10*1000000) >> exitFailure)
Peter