3 await, wait, waitpid \- wait for a process to exit
16 int await(char *s, int n)
19 causes a process to wait for any child process (see
25 information about the exited child.
31 .ta 6n +\w'long 'u +\w'msg[ERRLEN]; 'u
35 int pid; /* of loved one */
36 ulong time[3]; /* of loved one & descendants */
46 array contains the time the child and its descendants spent in user code,
47 the time spent in system calls, and the child's elapsed real time,
48 all in units of milliseconds.
50 contains the message that the child specified in
58 prefixed by the process name, a blank, the process id, and a colon.
60 If there are no more children to wait for,
62 returns immediately, with return value nil.
66 structure is allocated by
68 and should be freed after use.
69 For programs that only need the pid of the exiting program,
71 returns just the pid and discards the rest of the information.
73 The underlying system call is
75 which fills in the n-byte buffer
77 with a textual representation of the pid, times, and exit string.
78 There is no terminal NUL.
79 The return value is the length, in bytes, of the data.
81 The buffer filled in by
83 may be parsed (after appending a NUL) using
87 the resulting fields are, in order, pid, the three times, and the exit string,
91 If the representation is longer than
93 bytes, it is truncated but, if possible, properly formatted.
94 The information that does not fit in the buffer is discarded, so
97 will return the information about the next exiting child, not the remainder
98 of the truncated message.
99 In other words, each call to
101 returns the information about one child, blocking if necessary if no child has exited.
102 If the calling process has no living children,
107 .B /usr/local/plan9/src/libc/9syscall