466
|
1 <refentry id="wait">
|
|
2 <refnamediv>
|
468
|
3 <refname>Wait</refname>
|
|
4 <refpurpose>wait for task termination</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
|
9 <funcprototype>
|
|
10 <funcdef><function>wait</function></funcdef>
|
476
|
11 <paramdef>int *<parameter>status</parameter></paramdef>
|
|
12 </funcprototype>
|
|
13
|
|
14 <funcprototype>
|
|
15 <funcdef><function>wait</function></funcdef>
|
|
16 <paramdef><parameter>0</parameter></paramdef>
|
466
|
17 </funcprototype>
|
|
18 </funcsynopsis>
|
|
19
|
|
20 </refsynopsisdiv>
|
|
21
|
476
|
22 <refsect1><title>Assembler Equivalent</title>
|
|
23 <para>
|
|
24 os9 F$WAIT
|
|
25 </para>
|
|
26 </refsect1>
|
466
|
27 <refsect1><title>Description</title>
|
|
28 <para>
|
476
|
29 Wait is used to halt the current task until a child task has
|
|
30 terminated.
|
|
31 </para>
|
|
32 <para>
|
|
33 The call returns the task id of the terminating task and places
|
|
34 the status of that task in the integer pointed to by "status"
|
|
35 unless "status" is 0. A wait must be executed for each child
|
|
36 task spawned.
|
|
37 </para>
|
|
38 <para>
|
|
39 The status will contain the argument of the "exit" or "_exit"
|
|
40 call in the child task of the signal number if it was
|
|
41 interrupted. A normally terminating C program with no call to
|
|
42 "exit" or "_exit" has an implied call of "exit(0)".
|
|
43 </para>
|
|
44 </refsect1>
|
|
45 <refsect1><title>Caveats</title>
|
|
46 <para>
|
|
47 NOTE that the status is the OS-9 status code and is not
|
|
48 compatible with codes on other systems.
|
|
49 </para>
|
|
50 </refsect1>
|
|
51 <refsect1><title>Diagnostics</title>
|
|
52 <para>
|
|
53 -1 is returned if there is no child to be waited for.
|
|
54 </para>
|
|
55 </refsect1>
|
|
56 <refsect1><title>See Also</title>
|
|
57 <para>
|
|
58 fork(),signal(),exit(),_exit()
|
466
|
59 </para>
|
|
60 </refsect1>
|
|
61 </refentry>
|