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

Add ?cloexec:bool argument to wrapped Unix functions in Lwt_unix #901

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

MisterDA
Copy link
Contributor

@MisterDA MisterDA commented 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), or emulated
as best-effort with Unix.set_close_on_exec on older OCaml versions.

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

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
Copy link
Member

At least this looks good to me. @raphael-proust Could you confirm this as well?

@raphael-proust
Copy link
Collaborator

This looks ok to me as well.

@smorimoto smorimoto merged commit 0ebeccb into ocsigen:master Nov 19, 2021
@smorimoto
Copy link
Member

Thanks @MisterDA!

@MisterDA MisterDA deleted the cloexec branch November 19, 2021 10:44
MisterDA added a commit to MisterDA/lwt that referenced this pull request Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants