fopen vs. os::fopen and automatic closing of the file on exec

Florian Weimer fweimer at redhat.com
Thu Jan 30 13:37:46 UTC 2020


* Leo Korinth:

>> It's possible the most recent version of Linux without O_CLOEXEC
>> supported is no longer supported by OpenJDK, in which case we can
>> remove it. But I'm not sure what that version is. I have no idea if
>> fopen with "e" support has the same history as ::open and O_CLOEXEC.
>
> "e" is supported since glibc 2.7, released in 2007. Any support of
> libc versions older than 2.7 today would suprise me.

O_CLOEXEC has not been backported into the Red Hat Enterprise Linux 5
kernel (which is based on Linux 2.6.18).  Its glibc (based on the 2.5
upstream version) does not support it, either.

However, I expect that no one is going to support the next OpenJDK (LTS)
release on that platform, so I don't think this is something that
matters in the OpenJDK context.

Thanks,
Florian



More information about the hotspot-dev mailing list