diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-02 16:46:00 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-02 16:46:00 +0000 |
commit | 69ac3b4db5e44857c56b1e8053a73c0e4ed89404 (patch) | |
tree | d8cb8aad4b2bea633feef83298e0fc2764cabc80 /io.c | |
parent | 77f603cbc9e66c7847496bae97ddc4671d6d4849 (diff) |
merge revision(s) 39184:
add doc. for IO#close_on_exec=.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -3865,6 +3865,14 @@ rb_io_close_on_exec_p(VALUE io) * 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 |