Skip to content

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

Merged
smorimoto merged 1 commit intoocsigen:masterfrom
MisterDA:cloexec
Nov 19, 2021
Merged

Add ?cloexec:bool argument to wrapped Unix functions in Lwt_unix#901
smorimoto merged 1 commit intoocsigen:masterfrom
MisterDA:cloexec

Conversation

@MisterDA
Copy link
Copy Markdown
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
Copy Markdown
Member

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

@raphael-proust
Copy link
Copy Markdown
Collaborator

This looks ok to me as well.

@smorimoto smorimoto merged commit 0ebeccb into ocsigen:master Nov 19, 2021
@smorimoto
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

Missing cloexec parameter for Lwt_unix.socket function Add ?cloexec parameter to Lwt_unix functions that create file descriptors

3 participants