[commit: packages/process] master: Implement delegated control-C handling on Unix (#2301) (a0467f3)

git at git.haskell.org git at git.haskell.org
Wed Nov 20 21:08:59 UTC 2013


Repository : ssh://git@git.haskell.org/process

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a0467f3ee892f5843c1ba98bcb9630e1e5b4863b/process

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

commit a0467f3ee892f5843c1ba98bcb9630e1e5b4863b
Author: Duncan Coutts <duncan at well-typed.com>
Date:   Thu Nov 14 20:00:36 2013 +0000

    Implement delegated control-C handling on Unix (#2301)
    
    This is a generalisation of the SIGINT-ignoring that system and
    rawSystem do, to allow it to be used via the general createProcess.
    
    For the gory details of SIGINT handling, see
    http://www.cons.org/cracauer/sigint.html
    
    We implement the 'WCE' method described there.
    
    That important feature was only available to system and rawSystem
    (mirroring the C system() behaviour). These functions are very limited
    and indeed deprecated, so we need this feature in general. In particular
    projects like Cabal are suffering because they cannot do this properly
    (or need horrible workarounds copy and pasting much of System.Process
    and using System.Process.Internals).
    
    The feature is available now via a new delegate_ctlc flag in the
    CreateProcess options record. The use of signal handlers is still a
    little hairy, but probably better than before (for situations where
    there were multiple concurrent calls to system/rawSystem).
    
    One thing to note is that waitForProcess and getProcessExitCode can now
    throw the UserInterrupt exception.
    
    This is all documented in the haddock docs (both a short description and
    also the excruciating details).
    
    Authored-by: Duncan Coutts <duncan at well-typed.com>
    Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>


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

a0467f3ee892f5843c1ba98bcb9630e1e5b4863b
 System/Process.hs           |  110 ++++++++++++++++++++++------------
 System/Process/Internals.hs |  139 +++++++++++++++++++++++++++++++++----------
 cbits/runProcess.c          |   18 ++----
 include/runProcess.h        |    3 +-
 4 files changed, 188 insertions(+), 82 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a0467f3ee892f5843c1ba98bcb9630e1e5b4863b


More information about the ghc-commits mailing list