module Fd:This module implements miscellaneous functions related to UNIX file descriptors. Currently, the functions listed below are implemented.sig
..end
Fd.send_fd
and Fd.recv_fd
, which are respectively used to send
and receive descriptors. Tipically, this functionality is used to
allow a process to perform all the actions needed to acquire a
descriptor, which is then sent to another process, which will then
handle the data transfer operations on that descriptor.Fd.fexecve
, which is used to execute a program specified via a
file descriptor.exception Fd_error of string
Fd.send_fd
and Fd.recv_fd
when an error
is encountered. The string contains the error message.val send_fd : conn:Unix.file_descr -> fd:Unix.file_descr -> unit
Fd.recv_fd
defined in this module.
The descriptor is sent as a sized message, so the user application
may use the connection to other communication needs.
Raises Fd_error
This exception is raised on error.
conn
: The connection through which the descriptor will be sent.fd
: The descriptor to be sent.val recv_fd : conn:Unix.file_descr -> Unix.file_descr
Fd.send_fd
.Fd_error
This exception is raised on error.conn
: The connection through which the descriptor will be received.val fexecve : fd:Unix.file_descr -> args:string array -> env:string array -> 'a
Unix.execve
, but the program to be executed,
its first paramenter, is specified via a file descriptor. As is the case
with the Unix.execv*
functions, Fd.fexecve
never returns. If the
call succeeds, the current process is substituted by the new one.Fd_error
This exception is raised on error.fd
: The file descriptor corresponding to the program to be executed.args
: An array of arguments to be passed to the program.env
: The environment to the program.