Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8291067

macOS should use O_CLOEXEC instead of FD_CLOEXEC

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • b25
    • os_x

      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.

            gziemski Gerard Ziemski
            gziemski Gerard Ziemski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: