From: Tanaka Akira Date: 2011-07-22T23:49:31+09:00 Subject: [ruby-core:38399] Re: [Ruby 1.9 - Feature #5041] Set FD_CLOEXEC for all fds (except 0, 1, 2) 2011/7/21 Eric Wong : >> So I may change the default of :close_others to true even for system() and >> exec(). > > If so, I would like a way specify a set/array/hash of FDs/IOs we don't > want :close_others to automatically close on us. If you want to disable automatic close fd1, fd2, ..., use follows. h = { fd1 => fd1, fd2 => fd2, ... } system("command", h) system() (, exec(), IO.popen and spawn()) can take an option hash to specify fds to inherit to child process. See the manual of spawn() for details. -- Tanaka Akira