Repository : ssh://darcs.haskell.org//srv/darcs/packages/unix

On branch  : ghc-7.4

http://hackage.haskell.org/trac/ghc/changeset/8b3b1d4e73bb02d3571c4aeae3bbcdb39466ecd6

>---------------------------------------------------------------

commit 8b3b1d4e73bb02d3571c4aeae3bbcdb39466ecd6
Author: Simon Marlow <[email protected]>
Date:   Fri Mar 23 15:10:17 2012 +0000

    fix documentation for getAnyProcessStatus/getGroupProcessStatus (#5946)
    
    MERGED from commit e518038a0eca7dddbbd3d4326355db9c1d6f0068

>---------------------------------------------------------------

 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))



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to