RFR: 8291067: macOS should use O_CLOEXEC instead of FD_CLOEXEC

David Holmes dholmes at openjdk.org
Wed Aug 24 23:48:33 UTC 2022


On Tue, 23 Aug 2022 20:42:00 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> The comment says:
>> 
>>> On ancient Linux kernels the O_CLOEXEC flag will be ignored and we fall back to using FD_CLOEXEC (see below).
>> 
>> so that is a workaround to handle ancient Linux kernels, and such a workaround has no meaning for BSD unless it too has ancient versions that ignored O_CLOEXEC.
>> 
>> That said, how ancient are we talking about? That comment may be irrelevant today given the minimum supported kernel versions we have.
>
> I have tested O_CLOEXEC on macOS and it is available even at 10.9 I don't have hardware that can go earlier than that.
> 
> So it looks like on macOS we don't need the fallback, however, macOS is not the only BSD OS that we need to consider (?)
> 
> Should we leave the fallback for other BSD platforms?

Is there anything to suggest any BSD system has ever had this issue? This seems a Linux specific workaround that has no place on macOS or BSD.

-------------

PR: https://git.openjdk.org/jdk/pull/9663


More information about the hotspot-runtime-dev mailing list