package core_unix
Install
Dune Dependency
Authors
Maintainers
Sources
md5=f9a74834f239874286d84ec99d75e5fa
sha512=d020db759cde35c0e9d9919dee2c0ea5bb5b7a5ee75515be922d816f28eb9f74dba37e6e424a636e362eab5120b2c1e672f4e5ba798f2dac7974c0e135f80faf
doc/core_unix.signal_unix/Signal_unix/index.html
Module Signal_unix
Source
include module type of struct include Core.Signal end
type t = Core.Signal.t
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_t : t Bin_prot.Type_class.t
include Core_kernel.Comparable.S with type t := t
include Base.Comparable.S with type t := t
ascending
is identical to compare
. descending x y = ascending y x
. These are intended to be mnemonic when used like List.sort ~compare:ascending
and List.sort ~cmp:descending
, since they cause the list to be sorted in ascending or descending order, respectively.
clamp_exn t ~min ~max
returns t'
, the closest value to t
such that between t' ~low:min ~high:max
is true.
Raises if not (min <= max)
.
type comparator_witness = Core.Signal.comparator_witness
val comparator : (t, comparator_witness) Base__.Comparator.comparator
module Replace_polymorphic_compare = Core.Signal.Replace_polymorphic_compare
module Map = Core.Signal.Map
module Set = Core.Signal.Set
include Core_kernel.Hashable.S with type t := t
val hash_fold_t :
Ppx_hash_lib.Std.Hash.state ->
t ->
Ppx_hash_lib.Std.Hash.state
val hash : t -> Ppx_hash_lib.Std.Hash.hash_value
val hashable : t Base.Hashable.t
module Table = Core.Signal.Table
module Hash_set = Core.Signal.Hash_set
module Hash_queue = Core.Signal.Hash_queue
include Core_kernel.Stringable.S with type t := t
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 OCaml internal signal number. This is only for the use of the Core_unix
module.
to_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
(*Terminate the process
*)
]
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).
Queries the default system behavior for a signal.
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 listsigs
. - If
cmd
is`Block
, the signals insigs
are added to the set of blocked signals. - If
cmd
is`Unblock
, the signals insigs
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.
Ignore
No-op; can be used to test whether the target process exists and the current process has permission to signal it
The Expert
module contains functions that novice users should avoid, due to their complexity.