Module Core.Signal
Signal handlers.
include 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
texposed 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 varianttafterwards.
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.t
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> tval sexp_of_t : t -> Sexplib0.Sexp.t
include Core__.Import.Comparable.S with type t := t
include Core_kernel__.Comparable_intf.S_common
include Base.Comparable.S
include Base__.Comparable_intf.Polymorphic_compare
val ascending : t -> t -> intascendingis identical tocompare.descending x y = ascending y x. These are intended to be mnemonic when used likeList.sort ~compare:ascendingandList.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.
val descending : t -> t -> intval between : t -> low:t -> high:t -> boolbetween t ~low ~highmeanslow <= t <= high
val clamp_exn : t -> min:t -> max:t -> tclamp_exn t ~min ~maxreturnst', the closest value totsuch thatbetween t' ~low:min ~high:maxis true.Raises if
not (min <= max).
val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
val comparator : (t, comparator_witness) Base.Comparator.comparator
include Base__.Comparable_intf.Validate with type t := t
val 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.check
module Replace_polymorphic_compare : Core_kernel__.Comparable_intf.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__.Import.Hashable.S with type t := t
include Core__.Import.Hashable.Common
val compare : t -> t -> Core_kernel__.Import.intval hash_fold_t : Base.Hash.state -> t -> Base.Hash.stateval hash : t -> Base.Hash.hash_value
val hashable : t Core_kernel.Hashtbl.Hashable.t
module 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__.Import.Stringable.S with type t := t
val equal : t -> t -> boolval of_system_int : int -> tof_system_intandto_system_intreturn 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_intconstructs aSignal.tgiven an OCaml internal signal number. This is only for the use of theCore_unixmodule.
val to_caml_int : t -> intval to_string : t -> stringto_string treturns a human-readable name: "sigabrt", "sigalrm", ...
type sys_behavior=[|`ContinueContinue the process if it is currently stopped
|`Dump_coreTerminate the process and dump core
|`IgnoreIgnore the signal
|`StopStop the process
|`TerminateTerminate 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_behavior
val default_sys_behavior : t -> sys_behaviorQueries the default system behavior for a signal.
val handle_default : t -> unithandle_default tisset t `Default.
val ignore : t -> unitignore tisset t `Ignore.
type pid_spec=[|`Pid of Core__.Import.Pid.t|`My_group|`Group of Core__.Import.Pid.t]
val sexp_of_pid_spec : pid_spec -> Ppx_sexp_conv_lib.Sexp.t
val send : t -> pid_spec -> [ `Ok | `No_such_process ]send signal pid_specsendssignalto the processes specified bypid_spec.send_iis likesend, except that it silently returns if the specified processes don't exist.send_exnis likesend, except that it raises if the specified processes don't exist.All of
send,send_i, andsend_exnraise if you don't have permission to send the signal to the specified processes or ifsignalis unknown.
val send_i : t -> pid_spec -> unitval send_exn : t -> pid_spec -> unitval can_send_to : Core__.Import.Pid.t -> boolcan_send_to pidreturns true ifpidis running and the current process has permission to send it signals.
val sigprocmask : sigprocmask_command -> t list -> t listsigprocmask cmd sigschanges 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.
sigprocmaskreturns the set of previously blocked signals.- If
val sigpending : unit -> t listsigpending ()returns the set of blocked signals that are currently pending.
val sigsuspend : t list -> unitsigsuspend sigsatomically sets the blocked signals tosigsand waits for * a non-ignored, non-blocked signal to be delivered. On return, the blocked * signals are reset to their initial value.
val abrt : tDump_coreAbnormal termination
val alrm : tTerminateTimeout
val bus : tDump_coreBus error
val chld : tIgnoreChild process terminated
val cont : tContinueContinue
val fpe : tDump_coreArithmetic exception
val hup : tTerminateHangup on controlling terminal
val ill : tDump_coreInvalid hardware instruction
val int : tTerminateInteractive interrupt (ctrl-C)
val kill : tTerminateTermination (cannot be ignored)
val pipe : tTerminateBroken pipe
val poll : tTerminatePollable event
val prof : tTerminateProfiling interrupt
val quit : tDump_coreInteractive termination
val segv : tDump_coreInvalid memory reference
val sys : tDump_coreBad argument to routine
val stop : tStopStop
val term : tTerminateTermination
val trap : tDump_coreTrace/breakpoint trap
val tstp : tStopInteractive stop
val ttin : tStopTerminal read from background process
val ttou : tStopTerminal write from background process
val urg : tIgnoreUrgent condition on socket
val usr1 : tTerminateApplication-defined signal 1
val usr2 : tTerminateApplication-defined signal 2
val vtalrm : tTerminateTimeout in virtual time
val xcpu : tDump_coreTimeout in cpu time
val xfsz : tDump_coreFile size limit exceeded
val zero : tIgnoreNo-op; can be used to test whether the target process exists and the current process has permission to signal it
module Expert : sig ... endThe
Expertmodule contains functions that novice users should avoid, due to their complexity.
module Stable : sig ... end