Skip to content

Commit

Permalink
Support Unix.socketpair using PF_UNIX on Windows and OCaml 4.14
Browse files Browse the repository at this point in the history
Support for Unix domain sockets on Windows and a socketpair emulation
using PF_UNIX was added in OCaml 4.14 in PR 10192.
  • Loading branch information
MisterDA committed Oct 6, 2021
1 parent e12504e commit dad167f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/unix/lwt_unix.cppo.ml
Expand Up @@ -1689,7 +1689,11 @@ let shutdown ch shutdown_command =
external stub_socketpair : socket_domain -> socket_type -> int -> Unix.file_descr * Unix.file_descr = "lwt_unix_socketpair_stub"

let socketpair dom typ proto =
#if OCAML_VERSION >= (4, 05, 0)
#if OCAML_VERSION >= (4, 14, 0)
let do_socketpair =
if Sys.win32 && (dom <> Unix.PF_UNIX) then stub_socketpair
else Unix.socketpair ?cloexec:None in
#elif OCAML_VERSION >= (4, 05, 0)
let do_socketpair =
if Sys.win32 then stub_socketpair
else Unix.socketpair ?cloexec:None in
Expand Down

0 comments on commit dad167f

Please sign in to comment.