wait(2) plan9 man page | unix.com

Man Page: wait

Operating Environment: plan9

Section: 2

WAIT(2) 							System Calls Manual							   WAIT(2)

NAME
wait - wait for a process to exit
SYNOPSIS
#include <u.h> #include <libc.h> int wait(Waitmsg *w)
DESCRIPTION
Wait causes a process to wait for any child process (see fork(2)) to exit. It returns the pid of a child that has exited and fills in w with more information about the child. W points to a Waitmsg, which has this structure: typedef struct Waitmsg { char pid[12]; /* of loved one */ char time[3*12]; /* of loved one & descendants */ char msg[ERRLEN]; } Waitmsg; Pid is the child's process id. The time array contains the time the child and its descendants spent in user code, the time spent in system calls, and the child's elapsed real time, all in units of milliseconds. All integers in a Waitmsg are formatted as right-justified textual numbers in 11-byte fields followed by a blank. Msg contains the message that the child specified in exits(2). For a normal exit, msg[0] is zero, otherwise msg is prefixed by the process name, a blank, the process id, and a colon. If there are no more children to wait for, wait returns immediately, with return value -1.
SOURCE
/sys/src/libc/9syscall
SEE ALSO
fork(2), exits(2), the wait file in proc(3)
DIAGNOSTICS
Sets errstr. WAIT(2)
Related Man Pages
waitpid(2) - redhat
wait(2) - bsd
wait3(2) - bsd
fork(2) - ultrix
waitid(2) - hpux
Similar Topics in the Unix Linux Community
Forking in Unix using C++
fork()ing hell!!
How to find the actual process name
Make cron wait for the child process
Wait functionality in Solaris