of_system_int
and to_system_int
return and take respectively a signal number
corresponding to those in the system's /usr/include/bits/signum.h (or equivalent). It
is not guaranteed that these numbers are portable across any given pair of systems --
although some are defined as standard by POSIX.
of_caml_int
constructs a Signal.t given an O'Caml internal signal number. This is
only for the use of the Core_unix module.
to_string t
returns a human-readable name: "sigabrt", "sigalrm", ...
The default behaviour of the system if these signals trickle to the top level of a program. See include/linux/kernel.h in the Linux kernel source tree (not the file /usr/include/linux/kernel.h).
handle_default t
is set t `Default
.
ignore t
is set t `Ignore
.
send signal pid_spec
sends signal
to the processes specified by pid_spec
.
send_i
is like send
, except that it silently returns if the specified processes
don't exist.
send_exn
is like send
, except that it raises if the specified processes
don't exist.
All of send
, send_i
, and send_exn
raise if you don't have permission to send the
signal to the specified processes or if signal
is unknown.
can_send_to pid
returns true if pid
is running and the current process has
permission to send it signals.
sigprocmask cmd sigs
changes the set of blocked signals.
* If cmd
is `Set
, blocked signals are set to those in the list sigs
.
* If cmd
is `Block
, the signals in sigs
are added to the set of blocked
* signals.
* If cmd
is `Unblock
, the signals in sigs
are removed from the set of
* blocked signals.
* sigprocmask
returns the set of previously blocked signals.
sigpending ()
returns the set of blocked signals that are currently
* pending.
sigsuspend sigs
atomically sets the blocked signals to sigs
and waits for
* a non-ignored, non-blocked signal to be delivered. On return, the blocked
* signals are reset to their initial value.
Specific signals, along with their default behavior and meaning.
Dump_core
Abnormal termination
Dump_core
Abnormal termination
Terminate
Timeout
Terminate
Timeout
Ignore
Child process terminated
Ignore
Child process terminated
Continue
Continue
Continue
Continue
Dump_core
Arithmetic exception
Dump_core
Arithmetic exception
Terminate
Hangup on controlling terminal
Terminate
Hangup on controlling terminal
Dump_core
Invalid hardware instruction
Dump_core
Invalid hardware instruction
Terminate
Interactive interrupt (ctrl-C)
Terminate
Interactive interrupt (ctrl-C)
Terminate
Termination (cannot be ignored)
Terminate
Termination (cannot be ignored)
Terminate
Broken pipe
Terminate
Broken pipe
Terminate
Profiling interrupt
Terminate
Profiling interrupt
Dump_core
Interactive termination
Dump_core
Interactive termination
Dump_core
Invalid memory reference
Dump_core
Invalid memory reference
Stop
Stop
Stop
Stop
Terminate
Termination
Terminate
Termination
Stop
Interactive stop
Stop
Interactive stop
Stop
Terminal read from background process
Stop
Terminal read from background process
Stop
Terminal write from background process
Stop
Terminal write from background process
Terminate
Application-defined signal 1
Terminate
Application-defined signal 1
Terminate
Application-defined signal 2
Terminate
Application-defined signal 2
Terminate
Timeout in virtual time
Terminate
Timeout in virtual time
Ignore
No-op; can be used to test whether the target
process exists and the current process has
permission to signal it
Expert
module contains functions that novice users should avoid, due to their
complexity.