Feature #4512

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

Added by Eric Wong about 4 years ago. Updated over 3 years ago.

[ruby-core:35528]
Status:Closed
Priority:Normal
Assignee:Motohiro KOSAKI

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 Magnifier - 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 Magnifier - 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 Updated by Hiroshi Nakamura almost 4 years ago

  • Target version changed from 1.9.3 to 2.0.0

We're looking for a fcntl maintainer...

#2 Updated by Eric Wong almost 4 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 Updated by Motohiro KOSAKI almost 4 years ago

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

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 Updated by Motohiro KOSAKI over 3 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 Updated by Eric Wong over 3 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 Updated by Motohiro KOSAKI over 3 years ago

  • Status changed from Feedback to Assigned

#7 Updated by Motohiro KOSAKI over 3 years ago

I'm waiting the discussion of #5041.

#8 Updated by Motohiro KOSAKI over 3 years ago

  • Status changed from Assigned to Closed

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

Also available in: Atom PDF