On 12/07/2018 08:21, Andrew Luo wrote:
Thanks, I can refactor it. I’m not as familiar with the OpenJDK
architecture – should I just duplicate the function into libnio or is
there some common utility library that I should move it into? Also,
let me know what in net_util_* needs cleanup. The other instances of
socket/socketpair in Mac/AIX/Solaris I’m willing to handle as well.
Files are mostly already handled:
https://bugs.openjdk.java.net/browse/JDK-8043780 (in a similar way –
O_CLOEXEC on systems that support it and fcntl on other POSIX
systems). One other resource you mentioned is epolls. Perhaps
there’s also other file descriptors that are being used elsewhere, but
I think it will take me longer time to figure out. I’m willing to
work on that as well if we all think it’s a good idea.
JDK-8043780 was in libjvm so it doesn't cover file and networking I/O or
other file descriptors created in the libraries.
I agree with your comment that this could be done in steps as there are
many areas of the libraries that would changes to work with code that
uses fork/exec directly rather than ProcessBuilder/Process. It's okay to
start with the socket and channel APIs (native code in libnet and libnio).
-Alan.