-- * Waiting for signals
getPendingSignals, awaitSignal,
+ -- * The @NOCLDSTOP@ flag
+ setStoppedChildFlag, queryStoppedChildFlag,
+
-- MISSING FUNCTIONALITY:
-- sigaction(), (inc. the sigaction structure + flags etc.)
-- the siginfo structure
c_alarm :: CUInt -> IO CUInt
-- -----------------------------------------------------------------------------
+-- The NOCLDSTOP flag
+
+foreign import ccall "&nocldstop" nocldstop :: Ptr Int
+
+-- | Tells the system whether or not to set the @SA_NOCLDSTOP@ flag when
+-- installing new signal handlers.
+setStoppedChildFlag :: Bool -> IO Bool
+setStoppedChildFlag b = do
+ rc <- peek nocldstop
+ poke nocldstop x
+ return (rc == (0::Int))
+ where
+ x = case b of {True -> 0; False -> 1}
+
+-- | Queries the current state of the stopped child flag.
+queryStoppedChildFlag :: IO Bool
+queryStoppedChildFlag = do
+ rc <- peek nocldstop
+ return (rc == (0::Int))
+
+-- -----------------------------------------------------------------------------
-- Manipulating signal sets
newtype SignalSet = SignalSet (ForeignPtr CSigset)
/* -----------------------------------------------------------------------------
- * $Id: HsBase.h,v 1.25 2003/09/02 16:07:11 ross Exp $
+ * $Id: HsBase.h,v 1.26 2003/09/12 12:29:44 simonmar Exp $
*
* (c) The University of Glasgow 2001-2002
*
/* in writeError.c */
void writeErrString__(HsAddr msg_hdr, HsAddr msg, HsInt len);
+/* in Signals.c */
+extern HsInt nocldstop;
+
/* -----------------------------------------------------------------------------
64-bit operations, defined in longlong.c
-------------------------------------------------------------------------- */