RFR: 8291067: macOS should use O_CLOEXEC instead of FD_CLOEXEC
Daniel D. Daugherty
dcubed at openjdk.org
Thu Jul 28 20:06:53 UTC 2022
On Wed, 27 Jul 2022 19:19:44 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:
> O_CLOEXEC is also available on macOS (__DARWIN_C_LEVEL >= 200809L), so use it same as on linux.
Thumbs up. What Mach5 testing have you done here?
src/hotspot/os/bsd/os_bsd.cpp line 2215:
> 2213: // because it saves a system call and removes a small window where the flag
> 2214: // is unset. On ancient Linux kernels the O_CLOEXEC flag will be ignored
> 2215: // and we fall back to using FD_CLOEXEC (see below).
This comment was confusing me until I looked at os_linux.cpp and see
that you are getting in sync with the comments in that file (which is
where this code was ported from).
Your changes below are also getting in sync with the code in the
os_linux.cpp file.
Did you want to mention here the macOS version info that includes
the support for O_CLOEXEC?
-------------
Marked as reviewed by dcubed (Reviewer).
PR: https://git.openjdk.org/jdk/pull/9663
More information about the hotspot-runtime-dev
mailing list