diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-21 15:13:53 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-21 15:13:53 +0000 |
commit | 7abdd26013a187428735786ed3bdf8cd83ce015e (patch) | |
tree | 131161e2aae1934182d3a736b2a912ff9e2c987f | |
parent | 5f2ecbb345abe146255e27496f35c15d735db744 (diff) |
Add documentation to fork()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | process.c | 16 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com> + + * process.c: Add documentation for fork() + Tue Sep 21 18:29:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org> * array.c (rb_ary_equal): merge miss. @@ -1233,9 +1233,20 @@ rb_f_exec(argc, argv) /* * call-seq: + * Kernel.fork [{ block }] => fixnum or nil * Process.fork [{ block }] => fixnum or nil - * - * See <code>Kernel::fork</code>. + * + * Creates a subprocess. If a block is specified, that block is run + * in the subprocess, and the subprocess terminates with a status of + * zero. Otherwise, the +fork+ call returns twice, once in + * the parent, returning the process ID of the child, and once in + * the child, returning _nil_. The child process can exit using + * <code>Kernel.exit!</code> to avoid running any + * <code>at_exit</code> functions. The parent process should + * use <code>Process.wait</code> to collect the termination statuses + * of its children or use <code>Process.detach</code> to register + * disinterest in their status; otherwise, the operating system + * may accumulate zombie processes. */ static VALUE @@ -1416,6 +1427,7 @@ rb_f_system(argc, argv) if (RARRAY(argv[0])->len != 2) { rb_raise(rb_eArgError, "wrong first argument"); } + * Kernel.fork [{ block }] => fixnum or nil prog = RARRAY(argv[0])->ptr[0]; argv[0] = RARRAY(argv[0])->ptr[1]; } |