From 94b120fe7558f1b0dac644e096d8addf0e7f720a Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 3 Jun 2013 02:37:34 +0000 Subject: add some rdoc * add reference to spawn to fork * add an example which runs ruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'process.c') diff --git a/process.c b/process.c index 40ecfa6e2f..4ab1f647e9 100644 --- a/process.c +++ b/process.c @@ -3462,6 +3462,9 @@ rb_fork_ruby(int *status) * fork doesn't copy other threads. * * If fork is not usable, Process.respond_to?(:fork) returns false. + * + * Note that fork(2) is not avaiable on some platforms like Windows and NetBSD 4. + * Therefore you should use spawn() instead of fork(). */ static VALUE @@ -3819,6 +3822,9 @@ rb_f_system(int argc, VALUE *argv) * pid = spawn("tar xf ruby-2.0.0-p195.tar.bz2") * Process.wait pid * + * pid = spawn(RbConfig.ruby, "-eputs'Hello, world!'") + * Process.wait pid + * * This method is similar to Kernel#system but it doesn't wait for the command * to finish. * -- cgit v1.2.3