|
12 | 12 | * GNU Lesser General Public License for more details. |
13 | 13 | *) |
14 | 14 |
|
| 15 | +(** Module to send and receive file descriptors over UNIX domain sockets. *) |
| 16 | + |
15 | 17 | exception Unix_error of int |
16 | 18 | (** Thrown by the low-level C functions *) |
17 | 19 |
|
18 | | -val send_fd : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> Unix.file_descr -> int |
19 | | -(** [send_fd channel_fd buf ofs len flags fd_to_send] sends a message over [channel_fd] |
20 | | - containing the [buf] [ofs] [len] substring, with [flags] and file descriptor [fd_to_send] *) |
| 20 | +val send_fd : Unix.file_descr -> string -> int -> int -> |
| 21 | + Unix.msg_flag list -> Unix.file_descr -> int |
| 22 | +(** [send_fd channel_fd buf ofs len flags fd_to_send] sends a message |
| 23 | + over [channel_fd] containing the [buf] [ofs] [len] substring, with |
| 24 | + [flags] and file descriptor [fd_to_send], and returns the number |
| 25 | + of bytes sent. Note that you have to send a non-empty message |
| 26 | + (e.g. of size greater than zero) to actually have the fd |
| 27 | + passed. *) |
21 | 28 |
|
22 | | -val recv_fd : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> int * Unix.sockaddr * Unix.file_descr |
23 | | -(** [recv_fd channel_fd buf ofs len flags] receives a message into substring [buf] [ofs] [len] |
24 | | - with [flags], returning the number of bytes read, the address of the peer and a file descriptor *) |
| 29 | +val recv_fd : Unix.file_descr -> string -> int -> int -> |
| 30 | + Unix.msg_flag list -> int * Unix.sockaddr * Unix.file_descr |
| 31 | +(** [recv_fd channel_fd buf ofs len flags] receives a message into |
| 32 | + substring [buf] [ofs] [len] with [flags], returning the number of |
| 33 | + bytes read, the address of the peer and a file descriptor. *) |
25 | 34 |
|
26 | 35 | val int_of_fd : Unix.file_descr -> int |
27 | | -(** [int_of_fd fd] returns the underlying unix integer file descriptor associated with OCaml Unix.file_descr [fd] *) |
| 36 | +(** [int_of_fd fd] returns the underlying unix integer file descriptor |
| 37 | + associated with OCaml Unix.file_descr [fd]. *) |
28 | 38 |
|
29 | 39 | val fd_of_int : int -> Unix.file_descr |
30 | | -(** [fd_of_int fd] returns the OCaml Unix.file_descr associated with underlying unix integer [fd] *) |
| 40 | +(** [fd_of_int fd] returns the OCaml Unix.file_descr associated with |
| 41 | + underlying unix integer [fd]. *) |
0 commit comments