Project

General

Profile

Feature #4512

[PATCH] ext/fcntl/fcntl.c: add F_DUPFD_CLOEXEC constant

Added by Eric Wong over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:35528]

Description

=begin
It's in POSIX.1-2008 and will be useful when Ruby becomes more
multi-threaded.

related: http://redmine.ruby-lang.org/issues/1291

If/when 1291 goes through I'd also like IO#dup to work with the dup3()
system call, but this patch is much less intrusive.
=end

0001-ext-fcntl-fcntl.c-add-F_DUPFD_CLOEXEC-constant.patch View - patch to add constant (1.08 KB) Eric Wong, 03/20/2011 01:00 PM

0001-ext-fcntl-fcntl.c-add-F_DUPFD_CLOEXEC-constant.patch View - updated patch with test case (2.04 KB) Eric Wong, 07/01/2011 04:33 PM


Related issues

Related to Ruby trunk - Feature #5041: Set FD_CLOEXEC for all fds (except 0, 1, 2) Closed 10/24/2011
Related to Ruby trunk - Feature #1291: O_CLOEXEC flag missing for Kernel::open Closed 03/15/2009

History

#1 [ruby-core:37587] Updated by Hiroshi Nakamura over 5 years ago

  • Target version changed from 1.9.3 to 2.0.0

We're looking for a fcntl maintainer...

#2 [ruby-core:37601] Updated by Eric Wong over 5 years ago

Hiroshi Nakamura nakahiro@gmail.com wrote:

We're looking for a fcntl maintainer...

Since fcntl is related to I/O and files (and IO#fcntl is implemented in
io.c), why not just give this to io.c/file.c maintainers?

--
Eric Wong

#3 [ruby-core:37624] Updated by Motohiro KOSAKI over 5 years ago

  • Assignee set to Motohiro KOSAKI
  • Status changed from Open to Assigned

why not just give this to io.c/file.c maintainers?

We don't have io.c/file.c maintainers too. Anyway I assigned it to me. Please stop annoying ping pong.

#4 [ruby-core:37710] Updated by Motohiro KOSAKI about 5 years ago

  • Status changed from Assigned to Feedback

I've reviewed linux kernel source code and concluded this patch doesn't have the same issue with O_CLOEXEC when run on older kernels. So, I'll commit the patch if you make test case.

Thanks.

#5 [ruby-core:37713] Updated by Eric Wong about 5 years ago

Also pushed to "fcntl-dupfd-cloexec" branch of git://bogomips.org/ruby.git
http://bogomips.org/ruby.git/log/?h=fcntl-dupfd-cloexec

#6 [ruby-core:37742] Updated by Motohiro KOSAKI about 5 years ago

  • Status changed from Feedback to Assigned

#7 [ruby-core:38892] Updated by Motohiro KOSAKI about 5 years ago

I'm waiting the discussion of #5041.

#8 [ruby-core:40277] Updated by Motohiro KOSAKI almost 5 years ago

  • Status changed from Assigned to Closed

Akr committed #5041. so we can close this ticket too.

Also available in: Atom PDF