|
System.Posix.Signals | Portability | non-portable (requires POSIX) | Stability | provisional | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
POSIX signal support
|
|
Synopsis |
|
|
|
|
The Signal type
|
|
|
|
Specific signals
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sending signals
|
|
|
raiseSignal int calls kill to signal the current process
with interrupt signal int.
|
|
|
signalProcess int pid calls kill to signal process pid
with interrupt signal int.
|
|
|
signalProcessGroup int pgid calls kill to signal
all processes in group pgid with interrupt signal int.
|
|
Handling signals
|
|
|
The actions to perform when a signal is received.
| Constructors | Default | | Ignore | | Catch (IO ()) | | CatchOnce (IO ()) | |
| Instances | |
|
|
|
:: Signal | | -> Handler | | -> Maybe SignalSet | other signals to block
| -> IO Handler | old handler
| installHandler int handler iset calls sigaction to install an
interrupt handler for signal int. If handler is Default,
SIG_DFL is installed; if handler is Ignore, SIG_IGN is
installed; if handler is Catch action, a handler is installed
which will invoke action in a new thread when (or shortly after) the
signal is received.
If iset is Just s, then the sa_mask of the sigaction structure
is set to s; otherwise it is cleared. The previously installed
signal handler for int is returned
|
|
|
Signal sets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The process signal mask
|
|
|
getSignalMask calls sigprocmask to determine the
set of interrupts which are currently being blocked.
|
|
|
setSignalMask mask calls sigprocmask with
SIG_SETMASK to block all interrupts in mask.
|
|
|
blockSignals mask calls sigprocmask with
SIG_BLOCK to add all interrupts in mask to the
set of blocked interrupts.
|
|
|
unblockSignals mask calls sigprocmask with
SIG_UNBLOCK to remove all interrupts in mask from the
set of blocked interrupts.
|
|
The alarm timer
|
|
|
scheduleAlarm i calls alarm to schedule a real time
alarm at least i seconds in the future.
|
|
Waiting for signals
|
|
|
getPendingSignals calls sigpending to obtain
the set of interrupts which have been received but are currently blocked.
|
|
|
awaitSignal iset suspends execution until an interrupt is received.
If iset is Just s, awaitSignal calls sigsuspend, installing
s as the new signal mask before suspending execution; otherwise, it
calls pause. awaitSignal returns on receipt of a signal. If you
have installed any signal handlers with installHandler, it may be
wise to call yield directly after awaitSignal to ensure that the
signal handler runs as promptly as possible.
|
|
The NOCLDSTOP flag
|
|
|
Tells the system whether or not to set the SA_NOCLDSTOP flag when
installing new signal handlers.
|
|
|
Queries the current state of the stopped child flag.
|
|
Produced by Haddock version 2.6.1 |