package core_unix

  1. Overview
  2. Docs
Unix-specific portions of Core

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.1.tar.gz
md5=9370dca36f518fcea046d2752e3de22b
sha512=c4e8ce9d5885ac8fa8d554a97e1857f3a1c933e0eb5dfd4fe874412b9d09e6d0a2973b644733855553f33f5c859719228f0e6aaf3a2b7eb5befb46fc513750de

doc/core_unix.signal_unix/Signal_unix/index.html

Module Signal_unixSource

Signal handlers.

Sourceval of_system_int : int -> Core.Signal.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.

Sourceval to_system_int : Core.Signal.t -> int
Sourcetype pid_spec = [
  1. | `Pid of Core.Pid.t
  2. | `My_group
  3. | `Group of Core.Pid.t
]
Sourceval sexp_of_pid_spec : pid_spec -> Sexplib0.Sexp.t
Sourceval send : Core.Signal.t -> pid_spec -> [ `Ok | `No_such_process ]

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.

Sourceval send_i : Core.Signal.t -> pid_spec -> unit
Sourceval send_exn : Core.Signal.t -> pid_spec -> unit
Sourceval can_send_to : Core.Pid.t -> bool

can_send_to pid returns true if pid is running and the current process has permission to send it signals.

Sourcetype sigprocmask_command = [
  1. | `Set
  2. | `Block
  3. | `Unblock
]
Sourceval sigprocmask : sigprocmask_command -> Core.Signal.t list -> Core.Signal.t list

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.

Sourceval sigpending : unit -> Core.Signal.t list

sigpending () returns the set of blocked signals that are currently pending.

Sourceval sigsuspend : Core.Signal.t list -> unit

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.

OCaml

Innovation. Community. Security.