File: ref_m_process.html

package info (click to toggle)
rubybook 0.2.1-1
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k, lenny, squeeze, wheezy
  • size: 4,248 kB
  • ctags: 1,042
  • sloc: xml: 60,486; makefile: 25
file content (535 lines) | stat: -rw-r--r-- 21,105 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
<html><title>Programming Ruby: The Pragmatic Programmer's Guide</title><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><STYLE TYPE="text/css"><!--
       BODY    { margin-left: 1in;
                 width: 6in;
                 font-family: helvetica, arial, sans-serif;
               }
       H1      { color: #000080;
                 font-family: helvetica, arial, sans-serif;
                 font-size: 22pt;
                 margin-left: 0in
               }
       H2      { color: #000080;  font: bold x-large helvetica, sans-serif;
                 margin-left: 0in }
       H3      { color: #000080;  font: bold   large helvetica, sans-serif; }
       H4      { color: #000080;  font: italic large helvetica, sans-serif; }
       .ruby   { background: #fff0f0 }
       .header { color: white }
       .subheader { color: #ffdddd }
       .sidebar   { width: 6in }
       span.sans { font-family: helvetica, arial, sans-serif }
       -->
   </STYLE><table bgcolor="#a03030" cellpadding="3" border="0" cellspacing="0"><tr><td colspan="3"><table bgcolor="#902020" cellpadding="20"><tr><td><h1 class="header">Programming Ruby</h1><h3 class="subheader">The Pragmatic Programmer's Guide</h3></td></tr></table></td></tr><tr><td width="33%" align="left"><a class="subheader" href="ref_m_objectspace.html">Previous &lt;</a></td><td width="33%" align="center" valign="middle"><a class="subheader" href="builtins.html">Contents ^</a><br></td><td width="33%" align="right"></td></tr></table></head><body bgcolor="white">
<!--
    Copyright (c) 2001 by Addison Wesley Longman.  This
    material may be distributed only subject to the terms and
    conditions set forth in the Open Publication License, v1.0 or
    later (the latest version is presently available at
    http://www.opencontent.org/openpub/).
-->
<table><tr><td height="20"><img src="dot.gif" width="1" height="20"></td></tr></table><table border="0" width="100%" bgcolor="660066" cellpadding="10"><tr><td valign="center"><font color="white" size="7">module Process</font></td></tr></table><p></p><H3>Index:</H3><a href="#egid">egid</a> <a href="#egid_eq">egid=</a> <a href="#euid">euid</a> <a href="#euid_eq">euid=</a> <a href="#exit_oh">exit!</a> <a href="#fork">fork</a> <a href="#getpgid">getpgid</a> <a href="#getpgrp">getpgrp</a> <a href="#getpriority">getpriority</a> <a href="#gid">gid</a> <a href="#gid_eq">gid=</a> <a href="#kill">kill</a> <a href="#pid">pid</a> <a href="#ppid">ppid</a> <a href="#setpgid">setpgid</a> <a href="#setpgrp">setpgrp</a> <a href="#setpriority">setpriority</a> <a href="#setsid">setsid</a> <a href="#uid">uid</a> <a href="#uid_eq">uid=</a> <a href="#wait">wait</a> <a href="#wait2">wait2</a> <a href="#waitpid">waitpid</a> <a href="#waitpid2">waitpid2</a> <p></p><hr>
<P></P>
  The <code>Process</code> module is a collection of methods used to manipulate 
  processes.
<P></P>
  <table border="0" width="100%" cellpadding="10"><tr><td valign="center" colspan="3" bgcolor="990066"><font color="white" size="6">
         constants
       </font></td></tr></table><table border="2" cellpadding="5">
<tr>
  <td valign="top"><tr>
       <td><a name="PRIO_PGRP"><code>PRIO_PGRP</code></a></td>
       <td>1</td>
       <td>Process Group priority.</td>
     </tr>
<P></P>
  <tr>
       <td><a name="PRIO_PROCESS"><code>PRIO_PROCESS</code></a></td>
       <td>0</td>
       <td>Process priority.</td>
     </tr>
<P></P>
  <tr>
       <td><a name="PRIO_USER"><code>PRIO_USER</code></a></td>
       <td>2</td>
       <td>User priority.</td>
     </tr>
<P></P>
  <tr>
       <td><a name="WNOHANG"><code>WNOHANG</code></a></td>
       <td>1</td>
       <td>Do not block if no child has exited. Not
    available on all platforms.</td>
     </tr>
<P></P>
  <tr>
       <td><a name="WUNTRACED"><code>WUNTRACED</code></a></td>
       <td>2</td>
       <td>Return stopped children as well. Not
    available on all platforms.</td>
     </tr>
</td>
</tr>
</table><p></p>
<P></P>
  <table border="0" width="100%" cellpadding="10"><tr><td valign="center" colspan="2" bgcolor="990066"><font color="white" size="6">class methods
       </font></td></tr><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="egid"><b>egid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.egid 
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Returns the effective group id for this process.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.egid</code></td>
  <td valign="top"></td>
  <td valign="top"><code>500</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="egid_eq"><b>egid=</b></a></font></td><td bgcolor="#ffaaaa">
        Process.egid= <i>aFixnum</i>
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
            Sets the effective group id for this process.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="euid"><b>euid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.euid 
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Returns the effective user id for this process.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.euid</code></td>
  <td valign="top"></td>
  <td valign="top"><code>501</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="euid_eq"><b>euid=</b></a></font></td><td bgcolor="#ffaaaa">
        Process.euid= <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Sets the effective user id for this process.  
      Not available on all platforms.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="exit_oh"><b>exit!</b></a></font></td><td bgcolor="#ffaaaa">
        Process.exit!( <i>aFixnum</i>=-1 )
      </td></tr><td></td><td>
<P></P>
            Exits the process immediately.      
      No exit handlers are run.
      <i>aFixnum</i> is returned to the underlying system as the exit
      status. 
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="400"><tr><td><pre>
Process.exit!(0)
</pre></td></tr></table>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="fork"><b>fork</b></a></font></td><td bgcolor="#ffaaaa">
        Process.fork <i>[</i>{ block }
<i>]</i>
        -> <i>aFixnum</i> or <code>nil</code>
      </td></tr><td></td><td>
<P></P>
      See <a href="ref_m_kernel.html#fork"><code>Kernel::fork</code></a> on page 420.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="getpgid"><b>getpgid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.getpgid( <i>anInteger</i> )
        -> <i>anInteger</i>
      </td></tr><td></td><td>
<P></P>
      Returns the process group id for the given process id.
      Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.getpgid(Process.ppid())</code></td>
  <td valign="top"></td>
  <td valign="top"><code>13790</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="getpgrp"><b>getpgrp</b></a></font></td><td bgcolor="#ffaaaa">
        Process.getpgrp
        -> <i>anInteger</i>
      </td></tr><td></td><td>
<P></P>
      Returns the process group id for this process.
      Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.getpgid(0)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>13790</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.getpgrp</code></td>
  <td valign="top"></td>
  <td valign="top"><code>13790</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="getpriority"><b>getpriority</b></a></font></td><td bgcolor="#ffaaaa">
        Process.getpriority( <i>aKind</i>,
        <i>anInteger</i> ) -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Gets the      
      scheduling priority for specified process, process group, or
      user.  <i>aKind</i> indicates the kind of entity to find:
      one of <a href="ref_m_process.html#PRIO_PGRP"><code>Process::PRIO_PGRP</code></a>,
      <a href="ref_m_process.html#PRIO_USER"><code>Process::PRIO_USER</code></a>, or <a href="ref_m_process.html#PRIO_PROCESS"><code>Process::PRIO_PROCESS</code></a>.
      <i>anInteger</i> is an id indicating the particular process,
      process group, or user (an id of 0 means <em>current</em>).
      Lower priorities are more favorable for
      scheduling.  Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.getpriority(Process::PRIO_USER,&nbsp;0)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>0</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.getpriority(Process::PRIO_PROCESS,&nbsp;0)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>19</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="gid"><b>gid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.gid 
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Returns the group id for this process.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.gid</code></td>
  <td valign="top"></td>
  <td valign="top"><code>500</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="gid_eq"><b>gid=</b></a></font></td><td bgcolor="#ffaaaa">
        Process.gid= <i>aFixnum</i>
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
            Sets the group id for this process.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="kill"><b>kill</b></a></font></td><td bgcolor="#ffaaaa">
        Process.kill( <i>aSignal</i>, 
        <i>[</i><i>aPid</i><i>]<sup>+</sup></i> ) -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Sends the given signal to the specified process id(s),      
      or to the
      current process if <i>aPid</i> is zero.  <i>aSignal</i> may be an
      integer signal number or a POSIX signal name (either with or
      without a <code>SIG</code> prefix).  If <i>aSignal</i> is negative (or
      starts with a ``<code>-</code>'' sign), kills process groups instead
      of processes.  Not all signals are available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="400"><tr><td><pre>
trap("SIGHUP")&nbsp;{&nbsp;close_then_exit&nbsp;}
Process.kill("SIGHUP",&nbsp;0)
</pre></td></tr></table>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="pid"><b>pid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.pid -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Returns the process id of this process.
      Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.pid</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16488</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="ppid"><b>ppid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.ppid -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Returns the process id of the parent of this process.
      Always returns 0 on NT.
      Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="400"><tr><td><pre>
print&nbsp;"I&nbsp;am&nbsp;",&nbsp;Process.pid,&nbsp;"\n"
Process.fork&nbsp;{&nbsp;print&nbsp;"Dad&nbsp;is&nbsp;",&nbsp;Process.ppid,&nbsp;"\n"&nbsp;}
</pre></td></tr></table>

<em>produces:</em>
<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="400"><tr><td><pre>
I&nbsp;am&nbsp;16490
Dad&nbsp;is&nbsp;16490
</pre></td></tr></table>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="setpgid"><b>setpgid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.setpgid( <i>aPid</i>, <i>anInteger</i> )
        -> 0
      </td></tr><td></td><td>
<P></P>
            Sets the process group id of <i>aPid</i> (0 indicates this
      process) to <i>anInteger</i>.
      Not available on all platforms.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="setpgrp"><b>setpgrp</b></a></font></td><td bgcolor="#ffaaaa">
        Process.setpgrp
        -> 0
      </td></tr><td></td><td>
<P></P>
      Equivalent to <code>setpgid(0,0)</code>.
      Not available on all platforms.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="setpriority"><b>setpriority</b></a></font></td><td bgcolor="#ffaaaa">
        Process.setpriority( <i>kind</i>,
        <i>anInteger</i>, <i>anIntPriority</i> )
        -> 0
      </td></tr><td></td><td>
<P></P>
      See <a href="ref_m_process.html#getpriority"><code>Process#getpriority</code></a>.      
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.setpriority(Process::PRIO_USER,&nbsp;0,&nbsp;19)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>0</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.setpriority(Process::PRIO_PROCESS,&nbsp;0,&nbsp;19)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>0</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.getpriority(Process::PRIO_USER,&nbsp;0)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>19</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.getpriority(Process::PRIO_PROCESS,&nbsp;0)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>19</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="setsid"><b>setsid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.setsid
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Establishes this process as a new session and process group      
      leader, with no controlling tty.
      Returns the session id.
      Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.setsid</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16495</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="uid"><b>uid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.uid
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Returns the user id of this process.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.uid</code></td>
  <td valign="top"></td>
  <td valign="top"><code>501</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="uid_eq"><b>uid=</b></a></font></td><td bgcolor="#ffaaaa">
        Process.uid= <i>anInteger</i>
        -> <i>aNumeric</i>
      </td></tr><td></td><td>
<P></P>
      Sets the (integer) user id for this process.
      Not available on all platforms.
<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="wait"><b>wait</b></a></font></td><td bgcolor="#ffaaaa">
        Process.wait
        -> <i>aFixnum</i>
      </td></tr><td></td><td>
<P></P>
      Waits for any child process to exit and returns the process id
      of that child.      
      Raises a <code>SystemError</code> if there are no child processes.
      Not available on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.fork&nbsp;{&nbsp;exit&nbsp;1;&nbsp;}</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16500</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.wait</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16500</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="wait2"><b>wait2</b></a></font></td><td bgcolor="#ffaaaa">
        Process.wait2
        -> <i>anArray</i>
      </td></tr><td></td><td>
<P></P>
      Waits for any child process to exit and returns an array
      containing the process id and the exit status
      of that child.
      Raises a <code>SystemError</code> if there are no child processes.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
  <td valign="top"><code>Process.fork&nbsp;{&nbsp;exit&nbsp;1&nbsp;}</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16503</code></td>
</tr>
<tr>
  <td valign="top"><code>Process.wait2</code></td>
  <td valign="top"></td>
  <td valign="top"><code>[16503,&nbsp;256]</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="waitpid"><b>waitpid</b></a></font></td><td bgcolor="#ffaaaa">
        Process.waitpid( <i>aPid</i>,
        <i>anInteger</i>=0 )
        -> <i>aPid</i>
      </td></tr><td></td><td>
<P></P>
      Waits for the given child process to exit. <i>anInteger</i> may be 
      a logical or of the flag value
      <a href="ref_m_process.html#WNOHANG"><code>Process::WNOHANG</code></a> (do not block if no child available)
      or <a href="ref_m_process.html#WUNTRACED"><code>Process::WUNTRACED</code></a> (return stopped children that haven't 
      been reported).
      Not all flags are available on all platforms, but a flag value
      of zero will work on all platforms.
<P></P>

<table bgcolor="#fff0f0" cellspacing="0" border="0" cellpadding="3" width="500">
<tr>
<td colspan="3" valign="top"><code>include&nbsp;Process</code></td>
</tr>
<tr>
  <td valign="top"><code>pid&nbsp;=&nbsp;fork&nbsp;{&nbsp;sleep&nbsp;3&nbsp;}</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16506</code></td>
</tr>
<tr>
  <td valign="top"><code>Time.now</code></td>
  <td valign="top"></td>
  <td valign="top"><code>Sun&nbsp;Mar&nbsp;04&nbsp;23:31:14&nbsp;CST&nbsp;2001</code></td>
</tr>
<tr>
  <td valign="top"><code>waitpid(pid,&nbsp;Process::WNOHANG)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>nil</code></td>
</tr>
<tr>
  <td valign="top"><code>Time.now</code></td>
  <td valign="top"></td>
  <td valign="top"><code>Sun&nbsp;Mar&nbsp;04&nbsp;23:31:14&nbsp;CST&nbsp;2001</code></td>
</tr>
<tr>
  <td valign="top"><code>waitpid(pid,&nbsp;0)</code></td>
  <td valign="top"></td>
  <td valign="top"><code>16506</code></td>
</tr>
<tr>
  <td valign="top"><code>Time.now</code></td>
  <td valign="top"></td>
  <td valign="top"><code>Sun&nbsp;Mar&nbsp;04&nbsp;23:31:17&nbsp;CST&nbsp;2001</code></td>
</tr>
</table>
<P></P>

<P></P>
      </td><tr><td valign="center" bgcolor="#ff9999"><font size="4"><a name="waitpid2"><b>waitpid2</b></a></font></td><td bgcolor="#ffaaaa">
        Process.waitpid2( <i>aPid</i>,
        <i>anInteger</i>=0 )
        -> <i>anArray</i>
      </td></tr><td></td><td>
<P></P>
      Waits for the given child process to exit, returning that
      child's process id and exit status. <i>anInteger</i> may be 
      a logical or of the flag value
      <a href="ref_m_process.html#WNOHANG"><code>Process::WNOHANG</code></a> (do not block if no child available)
      or <a href="ref_m_process.html#WUNTRACED"><code>Process::WUNTRACED</code></a> (return stopped children that haven't 
      been reported).
      Not all flags are available on all platforms, but a flag value
      of zero will work on all platforms.
<P></P>
      </td></table>
<P></P>

<p></p><hr><table bgcolor="#a03030" cellpadding="10" border="0" cellspacing="0"><tr><td width="33%" align="left"><a class="subheader" href="ref_m_objectspace.html">Previous &lt;</a></td><td width="33%" align="center" valign="middle"><a class="subheader" href="builtins.html">Contents ^</a><br></td><td width="33%" align="right"></td></tr></table><p></p><font size="-1">Extracted from the book "Programming Ruby -
     The Pragmatic Programmer's Guide"</font><br><font size="-3">
      Copyright
      &#169;
      2000 Addison Wesley Longman, Inc. Released under the terms of the
      <a href="http://www.opencontent.org/openpub/">Open Publication License</a> V1.0.
        <br>
      This reference is available for
        <a href="http://www.pragmaticprogrammer.com/ruby/downloads/book.html">download</a>.
   </font></body></html>