Repository : ssh://darcs.haskell.org//srv/darcs/packages/process On branch : master
http://hackage.haskell.org/trac/ghc/changeset/007fb056f2e77e65196de4bff94ea001e69a12eb >--------------------------------------------------------------- commit 007fb056f2e77e65196de4bff94ea001e69a12eb Author: Simon Marlow <[email protected]> Date: Mon Sep 24 12:27:43 2012 +0100 Documentation for signal exit codes (#7229) >--------------------------------------------------------------- System/Process.hs | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/System/Process.hs b/System/Process.hs index 5a4a2b6..d34370e 100644 --- a/System/Process.hs +++ b/System/Process.hs @@ -333,6 +333,13 @@ runInteractiveProcess1 fun cmd = do GHC Note: in order to call @waitForProcess@ without blocking all the other threads in the system, you must compile the program with @-threaded@. + + On Unix systems, if the process died as the result of a signal, + then the exit code returned is @ExitFailure (128 + signal)@ where + @signal@ is the signal number. The signal numbers are + platform-specific, so to test for a specific signal use the + constants provided by @System.Posix.Signals@ in the @unix@ + package. -} waitForProcess :: ProcessHandle @@ -441,6 +448,9 @@ terminated. around 'createProcess'. Constructing variants of these functions is quite easy: follow the link to the source code to see how 'readProcess' is implemented. + +On Unix systems, see 'waitForProcess' for the meaning of exit codes +when the process died as the result of a signal. -} readProcessWithExitCode @@ -523,6 +533,9 @@ This computation may fail with On Windows, 'system' passes the command to the Windows command interpreter (@CMD.EXE@ or @COMMAND.COM@), hence Unixy shell tricks will not work. + +On Unix systems, see 'waitForProcess' for the meaning of exit codes +when the process died as the result of a signal. -} #ifdef __GLASGOW_HASKELL__ system :: String -> IO ExitCode @@ -656,7 +669,11 @@ interruptProcessGroupOf ph = do This is a non-blocking version of 'waitForProcess'. If the process is still running, 'Nothing' is returned. If the process has exited, then @'Just' e@ is returned where @e@ is the exit code of the process. + +On Unix systems, see 'waitForProcess' for the meaning of exit codes +when the process died as the result of a signal. -} + getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode) getProcessExitCode ph = do withProcessHandle ph $ \p_ -> _______________________________________________ Cvs-libraries mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-libraries
