Skip to content

Commit

Permalink
Improved documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Bernardoff committed May 23, 2013
1 parent 91c08ce commit ad2cb22
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions lib/fd_send_recv.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,28 @@
* GNU Lesser General Public License for more details.
*)

(** Module to send and receive file descriptors over UNIX domain sockets. *)

exception Unix_error of int
(** Thrown by the low-level C functions *)

val send_fd : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> Unix.file_descr -> int
(** [send_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] *)
val send_fd : Unix.file_descr -> string -> int -> int ->
Unix.msg_flag list -> Unix.file_descr -> int
(** [send_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. *)

val recv_fd : Unix.file_descr -> string -> int -> int -> Unix.msg_flag list -> int * Unix.sockaddr * Unix.file_descr
(** [recv_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 recv_fd : Unix.file_descr -> string -> int -> int ->
Unix.msg_flag list -> int * Unix.sockaddr * Unix.file_descr
(** [recv_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 int_of_fd : Unix.file_descr -> int
(** [int_of_fd fd] returns the underlying unix integer file descriptor associated with OCaml Unix.file_descr [fd] *)
(** [int_of_fd fd] returns the underlying unix integer file descriptor
associated with OCaml Unix.file_descr [fd]. *)

val fd_of_int : int -> Unix.file_descr
(** [fd_of_int fd] returns the OCaml Unix.file_descr associated with underlying unix integer [fd] *)
(** [fd_of_int fd] returns the OCaml Unix.file_descr associated with
underlying unix integer [fd]. *)

0 comments on commit ad2cb22

Please sign in to comment.