Fd_send_recvSourceModule to send and receive file descriptors over UNIX domain sockets.
Thrown by the low-level C functions
val send_fd :
Unix.file_descr ->
bytes ->
int ->
int ->
Unix.msg_flag list ->
Unix.file_descr ->
intsend_fd channel_fd buf ofs len flags fd_to_send sends a message over channel_fd containing the buf ofs len substring, with flags and file descriptor fd_to_send, and returns the number of bytes sent. Note that you have to send a non-empty message (e.g. of size greater than zero) to actually have the fd passed.
val recv_fd :
Unix.file_descr ->
bytes ->
int ->
int ->
Unix.msg_flag list ->
int * Unix.sockaddr * Unix.file_descrrecv_fd channel_fd buf ofs len flags receives a message into substring buf ofs len with flags, returning the number of bytes read, the address of the peer and a file descriptor.
val send_fd_substring :
Unix.file_descr ->
string ->
int ->
int ->
Unix.msg_flag list ->
Unix.file_descr ->
intLike send_fd but takes a string
int_of_fd fd returns the underlying unix integer file descriptor associated with OCaml Unix.file_descr fd.
fd_of_int fd returns the OCaml Unix.file_descr associated with underlying unix integer fd.