3 await, awaitnohang, awaitfor, wait, waitnohang, waitfor, waitpid \- wait for a process to exit
13 Waitmsg* waitnohang(void)
16 Waitmsg* waitfor(int pid)
22 int await(char *s, int n)
25 int awaitnohang(char *s, int n)
28 int awaitfor(int pid, char *s, int n)
31 causes a process to wait for any child process (see
39 information about the exited child.
45 .ta 6n +\w'long 'u +\w'msg[ERRLEN]; 'u
49 int pid; /* of loved one */
50 ulong time[3]; /* of loved one & descendants */
60 array contains the time the child and its descendants spent in user code,
61 the time spent in system calls, and the child's elapsed real time,
62 all in units of milliseconds.
64 contains the message that the child specified in
72 prefixed by the process name, a blank, the process id, and a colon.
74 If there are no more children to wait for,
76 returns immediately, with return value nil.
80 structure is allocated by
82 and should be freed after use.
83 For programs that only need the pid of the exiting program,
85 returns just the pid and discards the rest of the information.
90 but does not block if there are no more children to wait for.
91 Instead it returns immediately and sets
97 but waits for a particular
100 The underlying calls are
109 with a textual representation of the pid, times, and exit string.
110 There is no terminal NUL.
111 The return value is the length, in bytes, of the data.
114 may be parsed (after appending a NUL) using
118 the resulting fields are, in order, pid, the three times, and the exit string,
122 If the representation is longer than
124 bytes, it is truncated but, if possible, properly formatted.
125 The information that does not fit in the buffer is discarded, so
128 will return the information about the next exiting child, not the remainder
129 of the truncated message.
130 In other words, each call to
132 returns the information about one child, blocking if necessary if no child has exited.
133 If the calling process has no living children,
138 .B \*9/src/lib9/wait.c
140 .B \*9/src/lib9/await.c
148 To avoid name conflicts with the underlying system,
153 are preprocessor macros defined as