Skip to content

Add ?cloexec parameter to Lwt_unix functions that create file descriptors #327

@mfp

Description

@mfp

OCaml 4.05 adds an optional cloexec parameter to several Unix functions, allowing the close-on-exec flag to be set as the operation is performed atomically on some platforms (limited to Linux atm.) -- otherwise there's a race condition when there are multiple (system) threads.

These functions would be affected: Lwt_unix.dup, dup2, pipe, socket, socketpair, accept.
Other functions that build on them and could also take ?cloexec: accept_n, pipe_in, pipe_out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions