summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/exec_signals.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rts/exec_signals.hs')
-rw-r--r--testsuite/tests/rts/exec_signals.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/rts/exec_signals.hs b/testsuite/tests/rts/exec_signals.hs
new file mode 100644
index 0000000000..a9433d206a
--- /dev/null
+++ b/testsuite/tests/rts/exec_signals.hs
@@ -0,0 +1,20 @@
+import System.Process
+import System.Posix.Signals
+import Control.Monad(when)
+
+data SigState = Ignored | Default | Handled
+ deriving (Eq, Read, Show)
+
+data ChildInfo = ChildInfo {
+ masked :: [(Int,Bool)],
+ handlers :: [(Int, SigState)] }
+ deriving (Read, Show)
+
+main = do out <- readProcess "./exec_signals_child" [] ""
+ let ci = read out :: ChildInfo
+ blockedSigs = [x | (x, True) <- masked ci]
+ ignoredSigs = [x | (x, Ignored) <- handlers ci]
+ when (not $ null blockedSigs) $
+ putStrLn ("signals " ++ show blockedSigs ++ " are blocked")
+ when (not $ null ignoredSigs) $
+ putStrLn ("signals " ++ show ignoredSigs ++ " are ignored")