diff --git a/lib/async/release_async.ml b/lib/async/release_async.ml index 6c1bff7..7b3294e 100644 --- a/lib/async/release_async.ml +++ b/lib/async/release_async.ml @@ -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 "") end module Bytes = struct diff --git a/lib/core/release_future.mli b/lib/core/release_future.mli index 40bad9d..2979931 100644 --- a/lib/core/release_future.mli +++ b/lib/core/release_future.mli @@ -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 diff --git a/lib/lwt/release_lwt.ml b/lib/lwt/release_lwt.ml index f2f28d7..bc615e4 100644 --- a/lib/lwt/release_lwt.ml +++ b/lib/lwt/release_lwt.ml @@ -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