Skip to content

Commit 7abdd26

Browse files
author
dave
committed
Add documentation to fork()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 5f2ecbb commit 7abdd26

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Wed Sep 22 00:11:12 2004 Dave Thomas <dave@pragprog.com>
2+
3+
* process.c: Add documentation for fork()
4+
15
Tue Sep 21 18:29:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
26

37
* array.c (rb_ary_equal): merge miss.

process.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,20 @@ rb_f_exec(argc, argv)
12331233

12341234
/*
12351235
* call-seq:
1236+
* Kernel.fork [{ block }] => fixnum or nil
12361237
* Process.fork [{ block }] => fixnum or nil
1237-
*
1238-
* See <code>Kernel::fork</code>.
1238+
*
1239+
* Creates a subprocess. If a block is specified, that block is run
1240+
* in the subprocess, and the subprocess terminates with a status of
1241+
* zero. Otherwise, the +fork+ call returns twice, once in
1242+
* the parent, returning the process ID of the child, and once in
1243+
* the child, returning _nil_. The child process can exit using
1244+
* <code>Kernel.exit!</code> to avoid running any
1245+
* <code>at_exit</code> functions. The parent process should
1246+
* use <code>Process.wait</code> to collect the termination statuses
1247+
* of its children or use <code>Process.detach</code> to register
1248+
* disinterest in their status; otherwise, the operating system
1249+
* may accumulate zombie processes.
12391250
*/
12401251

12411252
static VALUE
@@ -1416,6 +1427,7 @@ rb_f_system(argc, argv)
14161427
if (RARRAY(argv[0])->len != 2) {
14171428
rb_raise(rb_eArgError, "wrong first argument");
14181429
}
1430+
* Kernel.fork [{ block }] => fixnum or nil
14191431
prog = RARRAY(argv[0])->ptr[0];
14201432
argv[0] = RARRAY(argv[0])->ptr[1];
14211433
}

0 commit comments

Comments
 (0)