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

Use open(O_CLOEXEC) instead of fcntl(FD_CLOEXEC)

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • hotspot
    • None
    • b40
    • linux
    • Not verified

    Backports

      Description

        JDK should use O_CLOEXEC when available; faster and less racy than FD_CLOEXEC.

        O_CLOEXEC is standardized.
        http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html

        Backward compatibility needs to be provided via #ifdef and checking (once) whether O_CLOEXEC works.

        All the Unix variants should have very similar changes to their os::open code applied.

        Webrev: http://cr.openjdk.java.net/~martin/webrevs/openjdk9/O_CLOEXEC/

        Attachments

          Issue Links

            Activity

              People

                martin Martin Buchholz
                martin Martin Buchholz
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: