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/

          Attachments

            Issue Links

              Activity

                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: