U:RDoc::AnyMethod[iI"close_on_exec=:ETI"IO#close_on_exec=;TF: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"Sets a close-on-exec flag.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"f = open("/dev/null") ;TI"f.close_on_exec = true ;TI"bsystem("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory ;TI"(f.closed? #=> false ;T: @format0o; ; [ I"FRuby sets close-on-exec flags of all file descriptors by default ;TI"since Ruby 2.0.0. ;TI"+So you don't need to set by yourself. ;TI"IAlso, unsetting a close-on-exec flag can cause file descriptor leak ;TI"Pif another thread use fork() and exec() (via system() method for example). ;TI"GIf you really needs file descriptor inheritance to child process, ;TI"+use spawn()'s argument such as fd=>fd.;T: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"2ios.close_on_exec = bool -> true or false ;T0[I" (p1);T@FI"IO;TcRDoc::NormalClass00