From 7abdd26013a187428735786ed3bdf8cd83ce015e Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 21 Sep 2004 15:13:53 +0000 Subject: Add documentation to fork() git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index 0113dc71da..e2f878c11e 100644 --- a/process.c +++ b/process.c @@ -1233,9 +1233,20 @@ rb_f_exec(argc, argv) /* * call-seq: + * Kernel.fork [{ block }] => fixnum or nil * Process.fork [{ block }] => fixnum or nil - * - * See Kernel::fork. + * + * 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 + * Kernel.exit! to avoid running any + * at_exit functions. The parent process should + * use Process.wait to collect the termination statuses + * of its children or use Process.detach 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]; } -- cgit v1.2.3