summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-21 15:13:53 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-21 15:13:53 +0000
commit4a69f0e61fa34078197bbb4340b2ba79403eaf89 (patch)
tree4eaa7ae518f61a36d51599be7e7e65ead5dbc7d1
parent07dabd6f511747856a8fc4feb3b9bb550b24f91b (diff)
downloadruby-4a69f0e61fa34078197bbb4340b2ba79403eaf89.tar.gz
ruby-4a69f0e61fa34078197bbb4340b2ba79403eaf89.tar.xz
ruby-4a69f0e61fa34078197bbb4340b2ba79403eaf89.zip
Add documentation to fork()
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--process.c13
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ba607e90..97c63c9b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com>
+
+ * process.c: Add documentation for fork()
+
Mon Sep 20 17:46:51 2004 Minero Aoki <aamine@loveruby.net>
* ext/ripper/lib/ripper/tokenizer.rb: fix typo.
diff --git a/process.c b/process.c
index 662b26d7c..b7be36fbf 100644
--- a/process.c
+++ b/process.c
@@ -1416,9 +1416,20 @@ rb_fork(status, chfunc, charg)
/*
* 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