summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-04 11:29:24 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-04 11:29:24 +0000
commitbe62297f9230c4cf8d73321c5c9e28037b35fc1d (patch)
tree8f8ef97f4db6938963daf0b6e4adffe957bb4af2 /io.c
parentc06da4735da0e2285c1e3e52202b7090b3f43b1b (diff)
* io.c (Init_IO): Added File::CLOEXEC constant. [ruby-core:22893] [Feature #1291]
* test/ruby/test_io.rb (TestIO#test_o_cloexec): test for File::CLOEXEC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index 0087254291..4336eeda0e 100644
--- a/io.c
+++ b/io.c
@@ -10576,6 +10576,10 @@ Init_IO(void)
/* Try to minimize cache effects of the I/O to and from this file. */
rb_file_const("DIRECT", INT2FIX(O_DIRECT));
#endif
+#ifdef O_CLOEXEC
+ /* enable close-on-exec flag */
+ rb_file_const("CLOEXEC", INT2FIX(O_CLOEXEC)); /* Linux, POSIX-2008. */
+#endif
sym_mode = ID2SYM(rb_intern("mode"));
sym_perm = ID2SYM(rb_intern("perm"));