Review Request: JDK-8001334 - Remove use of JVM_* functions from java.io code

Alan Bateman Alan.Bateman at oracle.com
Fri Feb 1 09:51:07 UTC 2013


On 01/02/2013 02:23, Martin Buchholz wrote:
> You could operate in paranoid mode and do *both* : use O_CLOEXEC and use
> fcntl to set the bit after creating it, perhaps after verifying via fcntl
> whether the bit was successfully set by open.
>
> Martin
>
>
Alternatively, just leave this code out. We open sockets and files in 
many other places in the libraries and don't explicitly enable the 
close-on-exec flag (we do set the inheritance flag on Windows so I guess 
we do have an inconsistency). Anyway, my point is that the Process code 
already handles this and closes the file descriptors in the child so I 
assume it doesn't matter if we have enabled the close-on-exec flag or 
not. There might of course be applications or other libraries that use 
fork+exec or variants directly, in which case there will be an issue if 
they expect all file descriptors to have the close-on-exec flag set. 
However, I assume we have this issue already as we just enable it 
consistently.

-Alan.



More information about the core-libs-dev mailing list