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

Use open(O_CLOEXEC) instead of fcntl(FD_CLOEXEC)

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b40
    • OS:
      linux
    • Verification:
      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/

          Activity

          Hide
          martin Martin Buchholz added a comment -
          Fixed deployed locally in production on Linux; ports to other platforms should be relatively easy, but we can't test them.
          Show
          martin Martin Buchholz added a comment - Fixed deployed locally in production on Linux; ports to other platforms should be relatively easy, but we can't test them.
          Hide
          martin Martin Buchholz added a comment -
          See also
          https://sourceware.org/bugzilla/show_bug.cgi?id=10353
          where Uli Drepper encourages everyone to switch to O_CLOEXEC ASAP, in his own inimitable style.
          Show
          martin Martin Buchholz added a comment - See also https://sourceware.org/bugzilla/show_bug.cgi?id=10353 where Uli Drepper encourages everyone to switch to O_CLOEXEC ASAP, in his own inimitable style.
          Hide
          martin Martin Buchholz added a comment -
          jdk9 sources have changed, so I had to adjust the webrev.

          Show
          martin Martin Buchholz added a comment - jdk9 sources have changed, so I had to adjust the webrev.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/6fc3b8261368
          User: dholmes
          Date: 2014-10-29 04:45:35 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/6fc3b8261368 User: dholmes Date: 2014-10-29 04:45:35 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/6fc3b8261368
          User: lana
          Date: 2014-11-17 19:26:14 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/6fc3b8261368 User: lana Date: 2014-11-17 19:26:14 +0000

            People

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

              Dates

              • Created:
                Updated:
                Resolved: