(original) (raw)
From: Tanaka Akira <akr@...> Date: 2009-03-15T13:50:55+09:00 Subject: [ruby-core:22899] Re: [Feature #1291] O_CLOEXEC flag missing for Kernel::open In article 49bc7c3c.05886e0a.09ae.ffffde11@mx.google.com, Nobuyoshi Nakada nobu@ruby-lang.org writes: > Is it Linux only? Yes. I think O_CLOEXEC should be used internally if Ruby sets close-on-exec flag for file descriptors, as Perl. (See $SYSTEM_FD_MAX in perlvar.) I guess Ruby may do it in future to avoid the race condition. The problem may be more realistic with MVM. However it changes system and exec incompatibly (on Unix). If it is changed and someone really want to inherit a file descriptor, system("command") need to be changed to system("command", fd=>fd). IO.popen and spawn doesn't affected because they close unrelated file descriptors by default. -- Tanaka Akira /nobu@ruby-lang.org</akr@...>