[前][次][番号順一覧][スレッド一覧]

ruby-changes:28991

From: naruse <ko1@a...>
Date: Mon, 3 Jun 2013 11:37:45 +0900 (JST)
Subject: [ruby-changes:28991] naruse:r41043 (trunk): add some rdoc

naruse	2013-06-03 11:37:34 +0900 (Mon, 03 Jun 2013)

  New Revision: 41043

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41043

  Log:
    add some rdoc
    
    * add reference to spawn to fork
    * add an example which runs ruby

  Modified files:
    trunk/process.c

Index: process.c
===================================================================
--- process.c	(revision 41042)
+++ process.c	(revision 41043)
@@ -3462,6 +3462,9 @@ rb_fork_ruby(int *status) https://github.com/ruby/ruby/blob/trunk/process.c#L3462
  *  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) https://github.com/ruby/ruby/blob/trunk/process.c#L3822
  *    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.
  *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]