mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Schwartzmeyer <>
Subject Review Request 65403: Windows: Implemented `os::cloexec` family for file descriptors.
Date Mon, 29 Jan 2018 20:35:54 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.

Bugs: MESOS-5882

Repository: mesos


The intent of `os::cloexec` (that is, the intent of the `CLOEXEC` flags
on Linux) is to disable the inheritance of handles. On Linux, the flag
specifically means to not duplicate the file descriptor on calls to the
`exec` family of functions (which spawn new processes). On Windows, the
logical equivalent is to set `HANDLE_FLAG_INHERIT` to `0`, which means
to not allow the handles (file descriptors) to be inherited (duplicated)
in child processes (exec).

Note that it is not possible to change the inheritance behavior of an
already-existing socket on Windows, so we log a warning and return
nothing. However, inheritance can be controlled at socket creation, and
so `os::isCloexec` supports sockets too.


  3rdparty/stout/include/stout/os/windows/fcntl.hpp 5800ec92f85401a80cb813afd880be2e5a24a3af




Andrew Schwartzmeyer

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message