package luv
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ccecf47311b384b8b7437eaac92b4d0b3f091971ed10241f672b0c2a2c8a3a43
md5=efe61a4b4725d59901984022c02ef698
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_NONBLOCK_PIPE. The flag was formerly known as UV_OVERLAPPED_PIPE in libuv. This requires libuv 1.21.0. On earlier versions, this optional argument does nothing.
Feature check: Luv.Require.(has 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.
?windows_hide_console and ?windows_hide_gui have no effect on libuv prior to 1.24.0.
Luv.Require.(has process_windows_hide_console)Luv.Require.(has process_windows_hide_gui)
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.