summaryrefslogtreecommitdiff
path: root/spec/ruby/core/process/fixtures/map_fd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/process/fixtures/map_fd.rb')
-rw-r--r--spec/ruby/core/process/fixtures/map_fd.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/process/fixtures/map_fd.rb b/spec/ruby/core/process/fixtures/map_fd.rb
new file mode 100644
index 0000000000..3ed887486b
--- /dev/null
+++ b/spec/ruby/core/process/fixtures/map_fd.rb
@@ -0,0 +1,9 @@
+fd = ARGV.shift.to_i
+
+f = File.for_fd(fd)
+f.autoclose = false
+begin
+ f.write "writing to fd: #{fd}"
+ensure
+ f.close
+end