RFR: 8291067: macOS should use O_CLOEXEC instead of FD_CLOEXEC [v2]
Gerard Ziemski
gziemski at openjdk.org
Mon Nov 14 21:09:47 UTC 2022
On Fri, 11 Nov 2022 10:35:09 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Gerard Ziemski has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - add test to verify that open(O_CLOEXEC) implies FD_CLOEXEC on macOS
>> - assume O_CLOEXEC on macOS
>
> src/hotspot/os/bsd/os_bsd.cpp line 2214:
>
>> 2212: // O_CLOEXEC is preferable to using FD_CLOEXEC on an open file descriptor
>> 2213: // because it saves a system call and removes a small window where the flag
>> 2214: // is unset.
>
> I'm not even sure this comment is useful. Your code is clear and obvious. Discussing an alternate route may be confusing if people don't know the history if this code.
Done.
> 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.
>> 2215: int fd = ::open(path, oflag|O_CLOEXEC, mode);
>
> Style nit: should there be spaces between |?
Done.
-------------
PR: https://git.openjdk.org/jdk/pull/9663
More information about the hotspot-runtime-dev
mailing list