Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing cloexec parameter for Lwt_unix.socket function #847

Closed
raphael-proust opened this issue Apr 12, 2021 · 0 comments · Fixed by #901
Closed

Missing cloexec parameter for Lwt_unix.socket function #847

raphael-proust opened this issue Apr 12, 2021 · 0 comments · Fixed by #901

Comments

@raphael-proust
Copy link
Collaborator

In Lwt_unix there is val socket : socket_domain -> socket_type -> int -> file_descr.
In Unix there is val socket : ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descr.

The unix wrapper should expose the cloexec parameter.

MisterDA added a commit to MisterDA/lwt that referenced this issue Nov 9, 2021
In the Lwt_unix module, add `?cloexec:bool` optional arguments to
functions that create file descriptors (`dup`, `dup2`, `pipe`,
`pipe_in`, `pipe_out`, `socket`, `socketpair`, `accept`, `accept_n`).
The `?cloexec` argument is simply forwarded to the wrapped Unix
function (with OCaml >= 4.05, see [ocaml/ocaml#650][650]), or emulated
as best-effort with `Unix.set_close_on_exec` on older OCaml versions.

Fix ocsigen#327. Fix ocsigen#847. See also ocsigen#872.

[650]: ocaml/ocaml#650
smorimoto pushed a commit to raphael-proust/lwt that referenced this issue Dec 2, 2021
In the Lwt_unix module, add `?cloexec:bool` optional arguments to
functions that create file descriptors (`dup`, `dup2`, `pipe`,
`pipe_in`, `pipe_out`, `socket`, `socketpair`, `accept`, `accept_n`).
The `?cloexec` argument is simply forwarded to the wrapped Unix
function (with OCaml >= 4.05, see [ocaml/ocaml#650][650]), or emulated
as best-effort with `Unix.set_close_on_exec` on older OCaml versions.

Fix ocsigen#327. Fix ocsigen#847. See also ocsigen#872.

[650]: ocaml/ocaml#650
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant