File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ let _ = Callback.register_exception "fd_send_recv.unix_error" (Unix_error (0))
1919external send_fd : Unix .file_descr -> bytes -> int -> int -> Unix .msg_flag list -> Unix .file_descr -> int = " stub_unix_send_fd_bytecode" " stub_unix_send_fd"
2020external recv_fd : Unix .file_descr -> bytes -> int -> int -> Unix .msg_flag list -> int * Unix .sockaddr * Unix .file_descr = " stub_unix_recv_fd"
2121
22+ let send_fd_substring channel_fd buf ofs len flags fd_to_send =
23+ send_fd channel_fd (Bytes. unsafe_of_string buf) ofs len flags fd_to_send
24+
2225let fd_of_int (x : int ) : Unix.file_descr = Obj. magic x
2326
2427let int_of_fd (x : Unix.file_descr ) : int = Obj. magic x
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ val recv_fd : Unix.file_descr -> bytes -> int -> int ->
3232 substring [buf] [ofs] [len] with [flags], returning the number of
3333 bytes read, the address of the peer and a file descriptor. *)
3434
35+ val send_fd_substring : Unix .file_descr -> string -> int -> int ->
36+ Unix .msg_flag list -> Unix .file_descr -> int
37+ (* * Like [send_fd] but takes a string *)
38+
3539val int_of_fd : Unix .file_descr -> int
3640(* * [int_of_fd fd] returns the underlying unix integer file descriptor
3741 associated with OCaml Unix.file_descr [fd]. *)
You can’t perform that action at this time.
0 commit comments