Project

General

Profile

Actions

Feature #1291

closed

O_CLOEXEC flag missing for Kernel::open

Added by davidroyalmartin (David Martin) over 12 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:22893]

Description

=begin
Linux has a the most useful O_CLOEXEC flag for open() that sets the CLOEXEC flag on the new file descriptor.

You can currently set the CLOEXEC flag on an open file descriptor using IO::fcntl(), but note that this does not work in a multithreaded program: If one thread does open/fcntl while another does an exec, there is a race condition that could produce a file descriptor leak. The only safe way to open a file with the CLOEXEC flag set in general (as far as I know) is to use the O_CLOEXEC flag to open().
=end


Files

0001-O_CLOEXEC.patch (705 Bytes) 0001-O_CLOEXEC.patch kosaki (Motohiro KOSAKI), 03/26/2010 11:42 PM
0001-O_CLOEXEC.patch (712 Bytes) 0001-O_CLOEXEC.patch kosaki (Motohiro KOSAKI), 03/26/2010 11:46 PM

Related issues

Related to Ruby master - Feature #4512: [PATCH] ext/fcntl/fcntl.c: add F_DUPFD_CLOEXEC constantClosedkosaki (Motohiro KOSAKI)03/20/2011Actions
Is duplicate of Ruby master - Feature #5041: Set FD_CLOEXEC for all fds (except 0, 1, 2)Closedakr (Akira Tanaka)10/24/2011Actions
Actions

Also available in: Atom PDF