diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-03-23 15:10:17 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-03-23 15:10:17 +0000 |
commit | e518038a0eca7dddbbd3d4326355db9c1d6f0068 (patch) | |
tree | a3b9a20bd562fb602c22cec94c950d0476844df8 | |
parent | d9031934f19e3dcc267bf4db6c8d6a2af664e746 (diff) |
fix documentation for getAnyProcessStatus/getGroupProcessStatus (#5946)
-rw-r--r-- | System/Posix/Process/Common.hsc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/System/Posix/Process/Common.hsc b/System/Posix/Process/Common.hsc index 47dea7c..790f55b 100644 --- a/System/Posix/Process/Common.hsc +++ b/System/Posix/Process/Common.hsc @@ -318,12 +318,15 @@ foreign import ccall safe "waitpid" c_waitpid :: CPid -> Ptr CInt -> CInt -> IO CPid -- | @'getGroupProcessStatus' blk stopped pgid@ calls @waitpid@, --- returning @'Just' (pid, tc)@, the 'ProcessID' and --- 'ProcessStatus' for any process in group @pgid@ if one is --- available, 'Nothing' otherwise. If @blk@ is 'False', then --- @WNOHANG@ is set in the options for @waitpid@, otherwise not. --- If @stopped@ is 'True', then @WUNTRACED@ is set in the --- options for @waitpid@, otherwise not. +-- returning @'Just' (pid, tc)@, the 'ProcessID' and 'ProcessStatus' +-- for any process in group @pgid@ if one is available, or 'Nothing' +-- if there are child processes but none have exited. If there are +-- no child processes, then 'getGroupProcessStatus' raises an +-- 'isDoesNotExistError' exception. +-- +-- If @blk@ is 'False', then @WNOHANG@ is set in the options for +-- @waitpid@, otherwise not. If @stopped@ is 'True', then +-- @WUNTRACED@ is set in the options for @waitpid@, otherwise not. getGroupProcessStatus :: Bool -> Bool -> ProcessGroupID @@ -336,10 +339,15 @@ getGroupProcessStatus block stopped pgid = 0 -> return Nothing _ -> do ps <- readWaitStatus wstatp return (Just (pid, ps)) + -- | @'getAnyProcessStatus' blk stopped@ calls @waitpid@, returning -- @'Just' (pid, tc)@, the 'ProcessID' and 'ProcessStatus' for any --- child process if one is available, 'Nothing' otherwise. If --- @blk@ is 'False', then @WNOHANG@ is set in the options for +-- child process if a child process has exited, or 'Nothing' if +-- there are child processes but none have exited. If there are no +-- child processes, then 'getAnyProcessStatus' raises an +-- 'isDoesNotExistError' exception. +-- +-- If @blk@ is 'False', then @WNOHANG@ is set in the options for -- @waitpid@, otherwise not. If @stopped@ is 'True', then -- @WUNTRACED@ is set in the options for @waitpid@, otherwise not. getAnyProcessStatus :: Bool -> Bool -> IO (Maybe (ProcessID, ProcessStatus)) |