Moduleunix-2.8.8.0Haskell2010
System.Posix.Signals
POSIX signal support
Contents
Synopsis
- type Signal
- value nullSignal
- value internalAbort
- value sigABRT
- value realTimeAlarm
- value sigALRM
- value busError
- value sigBUS
- value processStatusChanged
- value sigCHLD
- value continueProcess
- value sigCONT
- value floatingPointException
- value sigFPE
- value lostConnection
- value sigHUP
- value illegalInstruction
- value sigILL
- value keyboardSignal
- value sigINT
- value killProcess
- value sigKILL
- value openEndedPipe
- value sigPIPE
- value keyboardTermination
- value sigQUIT
- value segmentationViolation
- value sigSEGV
- value softwareStop
- value sigSTOP
- value softwareTermination
- value sigTERM
- value keyboardStop
- value sigTSTP
- value backgroundRead
- value sigTTIN
- value backgroundWrite
- value sigTTOU
- value userDefinedSignal1
- value sigUSR1
- value userDefinedSignal2
- value sigUSR2
- value pollableEvent
- value sigPOLL
- value profilingTimerExpired
- value sigPROF
- value badSystemCall
- value sigSYS
- value breakpointTrap
- value sigTRAP
- value urgentDataAvailable
- value sigURG
- value virtualTimerExpired
- value sigVTALRM
- value cpuTimeLimitExceeded
- value sigXCPU
- value fileSizeLimitExceeded
- value sigXFSZ
- value raiseSignal
- value signalProcess
- value signalProcessGroup
- data Handler
- data SignalInfo
- data SignalSpecificInfo
- value installHandler
- newtype SignalSet
- value emptySignalSet
- value fullSignalSet
- value reservedSignals
- value addSignal
- value deleteSignal
- value inSignalSet
- value getSignalMask
- value setSignalMask
- value blockSignals
- value unblockSignals
- value scheduleAlarm
- value getPendingSignals
- value awaitSignal
- value setStoppedChildFlag
- value queryStoppedChildFlag
- Packageunix-2.8.8.0
- Exports81
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceSignals.hsc
The Signal type
Specific signals
Alias for sigABRT.
Process abort signal.
Alias for sigALRM.
Alarm clock.
Alias for sigBUS.
Access to an undefined portion of a memory object.
Alias for sigCHLD.
Child process terminated, stopped, or continued.
Alias for sigCONT.
Continue executing, if stopped.
Alias for sigFPE.
Erroneous arithmetic operation.
Alias for sigHUP.
Hangup.
Alias for sigILL.
Illegal instruction.
Alias for sigINT.
Terminal interrupt signal.
Alias for sigKILL.
Kill (cannot be caught or ignored).
Alias for sigPIPE.
Write on a pipe with no one to read it.
Alias for sigQUIT.
Terminal quit signal.
Alias for sigSEGV.
Invalid memory reference.
Alias for sigSTOP.
Stop executing (cannot be caught or ignored).
Alias for sigTERM.
Termination signal.
Alias for sigTSTP.
Terminal stop signal.
Alias for sigTTIN.
Background process attempting read.
Alias for sigTTOU.
Background process attempting write.
Alias for sigUSR1.
User-defined signal 1.
Alias for sigUSR2.
User-defined signal 2.
Alias for sigPOLL.
Pollable event.
Alias for sigPROF.
Profiling timer expired.
Alias for sigSYS.
Bad system call.
Alias for sigTRAP.
Trace/breakpoint trap.
Alias for sigURG.
High bandwidth data is available at a socket.
Alias for sigVTALRM.
Virtual timer expired.
Alias for sigXCPU.
CPU time limit exceeded.
Alias for sigXFSZ.
File size limit exceeded.
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
DefaultSets the disposition of the signal to
SIG_DFL, which means we want the default action associated with the signal. For example, the default action forSIGTERM(and various other signals) is to terminate the process.IgnoreSet the disposition of the signal to
SIG_IGN, which means we want to ignore the signal. Ignored signals will not be delivered to the process, and if also blocked will not be added to the pending set for later delivery (if/when unblocked). Some signals (e.g.SIGSTOPandSIGKILL) cannot be caught or ignored. not yet: | HoldCatch (IO ())signal handler is not reset
CatchOnce (IO ())signal handler is automatically reset (via
SA_RESETHAND)CatchInfo (SignalInfo -> IO ())CatchInfoOnce (SignalInfo -> IO ())
Information about a received signal (derived from siginfo_t).
Constructors
Information specific to a particular type of signal
(derived from siginfo_t).
Constructors
installHandler 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 sigsuspend with current signal mask. Note that RTS
scheduler signal (either virtualTimerExpired or realTimeAlarm)
could cause premature termination of this call. It might be necessary to block that
signal before invocation of awaitSignal with blockSignals reservedSignals.
awaitSignal returns when signal was received and processed by a
signal handler, or if the signal could not be caught. 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.