ruby-changes:27132
From: akr <ko1@a...>
Date: Sun, 10 Feb 2013 13:15:03 +0900 (JST)
Subject: [ruby-changes:27132] akr:r39184 (trunk): add doc. for IO#close_on_exec=.
akr 2013-02-10 13:14:51 +0900 (Sun, 10 Feb 2013) New Revision: 39184 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39184 Log: add doc. for IO#close_on_exec=. Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 39183) +++ io.c (revision 39184) @@ -3865,6 +3865,14 @@ rb_io_close_on_exec_p(VALUE io) https://github.com/ruby/ruby/blob/trunk/io.c#L3865 * f.close_on_exec = true * system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory * f.closed? #=> false + * + * Ruby sets close-on-exec flags of all file descriptors by default + * since Ruby 2.0.0. + * So you don't need to set by yourself. + * Also, unsetting a close-on-exec flag can cause file descriptor leak + * if another thread use fork() and exec() (via system() method for example). + * If you really needs file descriptor inheritance to child process, + * use spawn()'s argument such as fd=>fd. */ static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/