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

Alan Bateman Alan.Bateman at oracle.com
Fri Feb 1 17:51:06 UTC 2013


On 01/02/2013 17:45, Martin Buchholz wrote:
> Yes, the current Process code deals fairly well with other people's 
> file descriptors that are not close-on-exec.  But this code is 
> brittle, and long-term it would be cleaner for all open's in the jdk 
> to use O_CLOEXEC by default.  We can probably never remove the Process 
> code that closes all file descriptors, because native user code could 
> also create file descriptors.  In the near term, until all the 
> posixoid systems we (might) run on support O_CLOEXEC, it seems better 
> to leave this code as is.  Or for general cleanliness, add O_CLOEXEC 
> by reflex whenever opening a file, without expectation that users will 
> ever see the benefit, unless they roll their own fork-exec.
There are lots of places in the JDK that open files or sockets, java.io 
is just one. It may be better if we separate this from Dan's clean-up 
and decide (as part of a separate piece of work) whether we want 
everywhere to enable close-on-exec on its file descriptors or just leave 
it to Process.exec as we do now.

-Alan



More information about the core-libs-dev mailing list