module Signal: Signaltype t
include Comparable.S
include Hashable.S
include Sexpable.S
val equal : t -> t -> boolval of_system_int : int -> tof_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.val to_system_int : t -> intval of_caml_int : int -> tof_caml_int constructs a Signal.t given an O'Caml internal signal
number. This is only for the use of the Unix module.val to_caml_int : t -> intval to_string : t -> stringto_string t returns a human-readable name: "sigabrt", "sigalrm", ...type sys_behavior =
| |
Continue |
(* | Continue the process if it is currently stopped | *) |
| |
Dump_core |
(* | Terminate the process and dump core | *) |
| |
Ignore |
(* | Ignore the signal | *) |
| |
Stop |
(* | Stop the process | *) |
| |
Terminate |
val sexp_of_sys_behavior : sys_behavior -> Sexplib.Sexp.tval sys_behavior_of_sexp : Sexplib.Sexp.t -> sys_behaviortypebehavior =[ `Default | `Handle of t -> unit | `Ignore ]
val sys_behavior : t -> sys_behaviorsys_behavior t
Query the default system behavior for a signal.val signal : t -> behavior -> behaviorsignal t
Set the behavior of the system on receipt of a given signal. The
first argument is the signal number. Return the behavior
previously associated with the signal. If the signal number is
invalid (or not available on your system), an Invalid_argument
exception is raised.val set : t -> behavior -> unitset t b is ignore (signal t b)val handle : t -> (t -> unit) -> unithandle t f is set t (`Handle f).val handle_default : t -> unithandle_default t is set t `Default.val ignore : t -> unitignore t is set t `Ignore.val send : ?process_must_exist:bool -> t -> pid:int -> unitsend signal ~pid sends signal to the process whose process id is pid.
In Caml's standard library, this is called Unix.kill.
Sending a signal to a zombie and/or nonexistent process will result in a
ESRCH unix error unless process_must_exist is false. By default,
process_must_exist is true.
typesigprocmask_command =[ `Block | `Set | `Unblock ]
val sigprocmask : sigprocmask_command -> t list -> t listsigprocmask 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.val sigpending : unit -> t listsigpending () returns the set of blocked signals that are currently
pending.val sigsuspend : t list -> unitsigsuspend 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.val abrt : t
Abnormal termination
val alrm : tval chld : tval cont : tval fpe : tval hup : tval ill : tval int : tval kill : tval pipe : tval prof : tval quit : tval segv : tval stop : tval term : tval tstp : tval ttin : tval ttou : tval usr1 : tval usr2 : tval vtalrm : t