[GHC] #7229: Detecting if a process was killed by a signal is impossible

GHC cvs-ghc at haskell.org
Thu Sep 27 11:13:42 CEST 2012


#7229: Detecting if a process was killed by a signal is impossible
----------------------------------+-----------------------------------------
    Reporter:  benmachine         |       Owner:                  
        Type:  bug                |      Status:  new             
    Priority:  high               |   Milestone:  7.6.2           
   Component:  libraries/process  |     Version:                  
    Keywords:                     |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple   |     Failure:  None/Unknown    
  Difficulty:  Unknown            |    Testcase:                  
   Blockedby:                     |    Blocking:                  
     Related:                     |  
----------------------------------+-----------------------------------------
Changes (by simonmar):

 * cc: dcoutts (added)


Comment:

 Duncan and I discussed this on IRC, and came up with the following API:

 [http://community.haskell.org/~simonmar/process-7229/System-
 Process.html#g:4]

 The rationale here is:

  * We don't want to change `ExitCode` for a couple of reasons: first, it
 is baked into Haskell 2010 and therefore difficult to change; second, it
 is really intended to be "exit codes you can pass to exitWith", so adding
 a terminated value wouldn't make much sense there.

  * We want to make it possible to obtain the full platform-specific info
 (e.g. `ProcessStatus`) out of the exit status.  Making an abstract type
 for `ExitStatus` allows us to do this in the future, by building separate
 platform-specific packages on top of process.

  * Clients can portably ask whether a process was terminated, but this
 will always return `Nothing` on non-Unix systems.

 I think `wasTerminated` is a bit clunky, the cases for "exited with an
 ExitCode" and "terminated" should really be mutually exclusive.  But we'd
 have to add another type to express that, which is perhaps going too far.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7229#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list