Project

General

Profile

Bug #3719

so_socketpair syscall should preserve FD_CLOEXEC flag

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

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

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Currently, if the two sockets passed to so_socketpair call have the FD_CLOEXEC flag set, they are preserved correctly if the stream type requested is SOCK_DGRAM, but for SOCK_STREAM, the first file descriptor is reallocated and the FD_CLOEXEC flag is cleared.

The code should be changed to detect the FD_CLOEXEC flag on fildes0 and preserve it in the case of SOCK_STREAM.

History

#1

Updated by Garrett D'Amore over 6 years ago

  • Status changed from New to Resolved

garrett@openindiana{115}> git log
commit 5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e
Author: Theo Schlossnagle <>
Date: Thu Apr 11 04:50:36 2013 +0000

3713 Implement accept4()
3714 Implement pipe2()
3715 Implement dup3()
3716 Implement mkostemp() and mkostemps()
3719 so_socketpair syscall should preserve FD_CLOEXEC flag
Reviewed by: Dan McDonald &lt;&gt;
Reviewed by: Robert Mustacchi &lt;&gt;
Approved by: Garrett D'Amore &lt;&gt;

Also available in: Atom PDF