diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-10 04:14:51 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-10 04:14:51 +0000 |
commit | a00c92f7fc5bb4b3f50e600da1280f0ed456bb22 (patch) | |
tree | 8583aa0c4357c17bb0a0623e7a81a8439123f327 | |
parent | 474e3cd2a72ab359b6a55a64539333ca65d51022 (diff) | |
download | ruby-a00c92f7fc5bb4b3f50e600da1280f0ed456bb22.tar.gz |
add doc. for IO#close_on_exec=.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 |