package eio

  1. Overview
  2. Docs

Spawning child processes with extra control.

This extends the Eio.Process API with more control over file-descriptors.

class virtual mgr : object ... end
val spawn_unix : sw:Eio.Std.Switch.t -> mgr -> ?cwd:Eio.Fs.dir Eio.Path.t -> fds:(int * Fd.t * Private.Fork_action.blocking) list -> ?env:string array -> ?executable:string -> string list -> Eio.Process.t

spawn_unix ~sw mgr ~fds args spawns a child process running the command args.

The arguments are as for Eio.Process.spawn, except that it takes a list of FD mappings for Fork_action.inherit_fds directly, rather than just flows for the standard streams.

val sigchld : Eio.Condition.t

If an Eio backend installs a SIGCHLD handler, the handler will broadcast on this condition.

This allows non-Eio libraries (such as Lwt) to share its signal handler.

Note: Not all backends install a handler (e.g. eio_linux uses process descriptors instead), so be sure to call install_sigchld_handler if you need to use this.

val install_sigchld_handler : unit -> unit

install_sigchld_handler () sets the signal handler for SIGCHLD to broadcast sigchld.

OCaml

Innovation. Community. Security.