package core
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8c158c12345d36a5cdd71081728f4317b2b04c09eb4126b6de00c482a6fec2a0
md5=b11f58205953d84cedb0003efcdab231
doc/core/Core/Signal/index.html
Module Core.Signal
Signal handlers.
include Core_kernel.Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
val bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (int -> t) Bin_prot.Read.readerThis function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.
val bin_shape_t : Bin_prot.Shape.tval bin_writer_t : t Bin_prot.Type_class.writerval bin_reader_t : t Bin_prot.Type_class.readerval bin_t : t Bin_prot.Type_class.tinclude 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).
val clamp : t -> min:t -> max:t -> t Base.Or_error.tinclude Base.Comparator.S with type t := t
val comparator : (t, comparator_witness) Base.Comparator.comparatorval validate_lbound : min:t Base.Maybe_bound.t -> t Base.Validate.checkval validate_ubound : max:t Base.Maybe_bound.t -> t Base.Validate.checkval validate_bound :
min:t Base.Maybe_bound.t ->
max:t Base.Maybe_bound.t ->
t Base.Validate.checkmodule Replace_polymorphic_compare :
Base.Comparable.Polymorphic_compare with type t := tmodule Map :
Core_kernel.Map.S
with type Key.t = t
with type Key.comparator_witness = comparator_witnessmodule Set :
Core_kernel.Set.S
with type Elt.t = t
with type Elt.comparator_witness = comparator_witnessinclude Core_kernel.Hashable.S with type t := t
include Core_kernel.Hashable.Common with type t := t
val compare : t -> t -> Base.Int.tval hash_fold_t :
Ppx_hash_lib.Std.Hash.state ->
t ->
Ppx_hash_lib.Std.Hash.stateval hash : t -> Ppx_hash_lib.Std.Hash.hash_valueval hashable : t Base.Hashable.tmodule Table : Core_kernel.Hashtbl.S with type key = tmodule Hash_set : Core_kernel.Hash_set.S with type elt = tmodule Hash_queue : Core_kernel.Hash_queue.S with type key = tinclude Core_kernel.Stringable.S with type t := t
val of_string : string -> tval 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 OCaml internal signal number. This is only for the use of the Core_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(*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).
val sexp_of_sys_behavior : sys_behavior -> Ppx_sexp_conv_lib.Sexp.tval sys_behavior_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> sys_behaviorval __sys_behavior_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> sys_behaviorval default_sys_behavior : t -> sys_behaviorQueries the default system behavior for a signal.
val handle_default : t -> unithandle_default t is set t `Default.
val ignore : t -> unitignore t is set t `Ignore.
val sexp_of_pid_spec : pid_spec -> Ppx_sexp_conv_lib.Sexp.tsend 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.
val can_send_to : Core_kernel.Pid.t -> boolcan_send_to pid returns true if pid is running and the current process has permission to send it signals.
val sigprocmask : sigprocmask_command -> t list -> t listsigprocmask cmd sigs changes the set of blocked signals.
- If
cmdis`Set, blocked signals are set to those in the listsigs. - If
cmdis`Block, the signals insigsare added to the set of blocked signals. - If
cmdis`Unblock, the signals insigsare 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.
Specific signals, along with their default behavior and meaning.
val abrt : tDump_core Abnormal termination
val alrm : tTerminate Timeout
val bus : tDump_core Bus error
val chld : tIgnore Child process terminated
val cont : tContinue Continue
val fpe : tDump_core Arithmetic exception
val hup : tTerminate Hangup on controlling terminal
val ill : tDump_core Invalid hardware instruction
val int : tTerminate Interactive interrupt (ctrl-C)
val kill : tTerminate Termination (cannot be ignored)
val pipe : tTerminate Broken pipe
val poll : tTerminate Pollable event
val prof : tTerminate Profiling interrupt
val quit : tDump_core Interactive termination
val segv : tDump_core Invalid memory reference
val sys : tDump_core Bad argument to routine
val stop : tStop Stop
val term : tTerminate Termination
val trap : tDump_core Trace/breakpoint trap
val tstp : tStop Interactive stop
val ttin : tStop Terminal read from background process
val ttou : tStop Terminal write from background process
val urg : tIgnore Urgent condition on socket
val usr1 : tTerminate Application-defined signal 1
val usr2 : tTerminate Application-defined signal 2
val vtalrm : tTerminate Timeout in virtual time
val xcpu : tDump_core Timeout in cpu time
val xfsz : tDump_core File size limit exceeded
val zero : tIgnore No-op; can be used to test whether the target process exists and the current process has permission to signal it
module Expert : sig ... endThe Expert module contains functions that novice users should avoid, due to their complexity.
module Stable : sig ... end