To better support fork and exec from native code, SOCK_CLOEXEC, if available, should be set by the Socket and Channel API's when creating new sockets.
This issue has been filed to track the, similar, proposal on net-dev:
http://mail.openjdk.java.net/pipermail/net-dev/2018-July/011622.html
This JIRA issue, by itself, does not completely resolve the problem of native code calling fork/exec, it may still have to deal with other file descriptors that are inherited by the child. Instead this JIRA issue is targeted at the socket and channels areas only, other areas should be tackled on a phased approach through separate JIRA issues.
This issue has been filed to track the, similar, proposal on net-dev:
http://mail.openjdk.java.net/pipermail/net-dev/2018-July/011622.html
This JIRA issue, by itself, does not completely resolve the problem of native code calling fork/exec, it may still have to deal with other file descriptors that are inherited by the child. Instead this JIRA issue is targeted at the socket and channels areas only, other areas should be tackled on a phased approach through separate JIRA issues.