From the Linux comment of os::open
// O_CLOEXEC is preferable to using FD_CLOEXEC on an open file descriptor
// because it saves a system call and removes a small window where the flag
// is unset. On ancient Linux kernels the O_CLOEXEC flag will be ignored
// and we fall back to using FD_CLOEXEC (see below).
On macOS if __DARWIN_C_LEVEL >= 200809L then we have access to O_CLOEXEC and we should use it instead.
// O_CLOEXEC is preferable to using FD_CLOEXEC on an open file descriptor
// because it saves a system call and removes a small window where the flag
// is unset. On ancient Linux kernels the O_CLOEXEC flag will be ignored
// and we fall back to using FD_CLOEXEC (see below).
On macOS if __DARWIN_C_LEVEL >= 200809L then we have access to O_CLOEXEC and we should use it instead.
- relates to
-
JDK-8298321 2 File Leak defect groups in 2 files
-
- Resolved
-
-
JDK-8291060 OPEN_MAX is no longer the max limit on macOS >= 10.6 for RLIMIT_NOFILE
-
- Closed
-