package luv
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=3d96ae0e118385f60921787826c2e4665e9809f9748ec7dec276e821e4761bf2
md5=a196396b63bbe9ff9e8b932b58010b18
doc/luv/Luv/Process/index.html
Module Luv.ProcessSource
Subprocesses.
See Processes in the user guide and uv_process_t — Process handle in libuv.
Binds uv_process_t.
Note that values of this type can be passed to functions in Luv.Handle, in addition to the functions in this module. In particular, see Luv.Handle.close.
File descriptor redirections for use with Luv.Process.spawn.
val to_parent_pipe :
?readable_in_child:bool ->
?writable_in_child:bool ->
?overlapped:bool ->
fd:int ->
parent_pipe:Pipe.t ->
unit ->
redirectionCauses ~fd in the child to be connected to ~to_parent_pipe in the parent.
Binds UV_CREATE_PIPE.
?readable_in_child sets UV_READABLE_PIPE, and ?writable_in_child sets UV_WRITABLE_PIPE.
?overlapped sets UV_OVERLAPPED_PIPE.
Causes ~fd in the child to be connected to the same device or peer as ~from_parent_fd in the parent.
Binds UV_INHERIT_FD.
Same as Luv.Process.inherit_fd, but takes a Luv.Stream.t for the parent file descriptor.
Binds UV_INHERIT_STREAM.
val spawn :
?loop:Loop.t ->
?on_exit:(t -> exit_status:int64 -> term_signal:int -> unit) ->
?environment:(string * string) list ->
?working_directory:string ->
?redirect:redirection list ->
?uid:int ->
?gid:int ->
?windows_verbatim_arguments:bool ->
?detached:bool ->
?windows_hide:bool ->
?windows_hide_console:bool ->
?windows_hide_gui:bool ->
string ->
string list ->
(t, Error.t) Result.resultStarts a process.
Binds uv_spawn.
Most of the optional arguments correspond to the fields of uv_process_options_t, which are documented here. The remaining arguments correspond to flags from uv_process_flags.
On Unix, the ~term_signal argument to ?on_exit will be non-zero if the process was terminated by a signal. In this case, the ~exit_status is invalid.
On Windows, ~term_signal and ~exit_status are independent of each other. ~term_signal is set by Luv.Process.kill, i.e. it is emulated by libuv. The operating system separately reports ~exit_status, so it is always valid. If there is an error retrieving ~exit_status from the OS, it is set to a negative value.
Redirections for STDIN, STDOUT, STDERR that are not specified are set by Luv to UV_IGNORE. This causes libuv to open new file descriptors for the child process, and redirect them to /dev/null or nul.
Disables (tries) file descriptor inheritance for inherited descriptors.
Binds uv_disable_stdio_inheritance.
Sends the given signal to the process.
Binds uv_process_kill. See kill(3p).
See Luv.Signal for signal numbers.
Sends the given signal to the process with the given pid.
Binds uv_kill.
See Luv.Signal for signal numbers.
Evaluates to the pid of the process.
Binds uv_process_get_pid.