summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index b549b6f770..c4427be33c 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1558,4 +1558,19 @@ class TestProcess < Test::Unit::TestCase
}
end if File.executable?("/bin/sh")
+ def test_setsid
+ return unless Process.respond_to?(:setsid)
+ return unless Process.respond_to?(:getsid)
+
+ IO.popen(["./ruby-trunk", "-e", <<EOS]) do|io|
+ Marshal.dump(Process.getsid, STDOUT)
+ newsid = Process.setsid
+ Marshal.dump(newsid, STDOUT)
+ STDOUT.flush
+EOS
+
+ assert_equal(Marshal.load(io), Process.getsid)
+ assert_equal(Marshal.load(io), Process.getsid(io.pid))
+ end
+ end
end