Project

General

Profile

Feature #3666

Implement SOCK_CLOEXEC flag to socket()

Added by Theo Schlossnagle over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
kernel
Start date:
2013-04-01
Due date:
% Done:

100%

Estimated time:
1.00 h
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Allow creating a socket with the close-on-exec flag set as it is added to the process file table. This prevents the race between socket() and fcntl(..., F_SETFD, FD_CLOEXEC). This is implemented on Linux and Solaris 11.

The implementation is non-obvious in that it bastardizes the "type" argument to socket and bitwise-inclusive-OR's a flag onto it. But as software is written that uses it, we might as well support it.

#1

Updated by Theo Schlossnagle over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF