module Unix_utils: Unix_utils
Handling RAM limits
val physical_ram : unit -> int64
physical_ram ()
Returns the total amount of physical RAM in bytes.
val ram_limit_spec : Core.Std.Arg.t
ram_limit_spec
command line arguments to set ram limits.
Signal handling
val wrap_block_signals : (unit -> 'a) -> 'a
wrap_block_signals f
blocks all signals before execution of f
, and
restores them afterwards.
val ensure_at_exit : unit -> unit
ensure_at_exit ()
: catch all signals, run at_exit functions,
then re-deliver the signal to self to ensure the default behavior.
at_exit functions are honored only when terminating by exit, not by signals,
so we need to do some tricks to get it run by signals too
val get_ppids : Core.Std.Pid.t -> Core.Std.Pid.t list option
get_ppids pid
returns the list of parent pids, up to init (1) for pid.