package b0
Software construction and deployment kit
Install
Dune Dependency
Authors
Maintainers
Sources
b0-0.0.3.tbz
sha512=d24b09eb520b8b91a1e5715badc9f5bcd6a6ec49c047f719a07afef6b835c128dc63e00c3be73d5353b037f4c3c9f2889e40666b30e297e872e4d011f098394c
doc/b0_b00_std/B00_std/Os/Exit/index.html
Module Os.Exit
Program exit.
Specifying exits
The type for specifying program exits. Either an exit code or a function (should be) calling B00_std.Cmd.execv
.
val code : int -> t
code c
is Code c
.
val exec : ?env:Env.assignments -> ?cwd:Fpath.t -> Fpath.t -> Cmd.t -> t
exec ?env ?cwd file argv
is an Exec _
. That has a call to Os.Cmd.execv
with the corresponding arguments.
Exiting exits
val exit : t -> ('a, string) Stdlib.result
exit e
exits according to e
:
- If
e
isCode c
,Stdlib.exit
c
is called and the function never returns. - If
e
isExec execv
,execv
is called. This can only return with anError _
. In that case log it and call the function again with an error code - this guarantees termination.
Signal exit hooks
on_sigint ~hook f
calls f ()
and returns its value. If SIGINT
is signalled during that time hook
is called followed by exit 130
– that is the exit code a SIGINT
would produce.
on_sigint
replaces an existing signal handler for Sys.sigint
during time of the function call. It is restored when the function returns.
Note. Since Stdlib.exit
is called Stdlib.at_exit
functions are called if a SIGINT
occurs during the call to f
. This is not the case on an unhandled SIGINT
.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page