Skip to content

Commit

Permalink
Add Release_future.wrap_file_descr
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenth committed Feb 5, 2015
1 parent 8ad7139 commit d5ee6aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/async/release_async.ml
Expand Up @@ -243,6 +243,9 @@ struct
| Ok () -> Std_unix.WEXITED 0
| Error (`Exit_non_zero s) -> Std_unix.WEXITED s
| Error (`Signal s) -> Std_unix.WSIGNALED (Signal.to_caml_int s)

let wrap_file_descr fd =
Fd.create (Fd.Kind.Socket `Active) fd (Info.of_string "<wrap_file_descr>")
end

module Bytes = struct
Expand Down
1 change: 1 addition & 0 deletions lib/core/release_future.mli
Expand Up @@ -92,6 +92,7 @@ module type S = sig
val unix_socket_of_fd : fd -> ('state, unix) socket
val unlink : string -> unit future
val waitpid : int -> Unix.process_status future
val wrap_file_descr : Unix.file_descr -> fd
end

module Bytes : sig
Expand Down
2 changes: 2 additions & 0 deletions lib/lwt/release_lwt.ml
Expand Up @@ -138,6 +138,8 @@ struct
let unlink = Lwt_unix.unlink
let waitpid pid =
Lwt_unix.waitpid [] pid >>= fun (_, status) -> return status
let wrap_file_descr fd =
Lwt_unix.of_unix_file_descr fd
end

module Bytes = struct
Expand Down

0 comments on commit d5ee6aa

Please sign in to comment.