waitpid() ???

Chris Torek chris at mimsy.umd.edu
Mon Aug 13 10:48:03 AEST 1990


In article <MITCH.90Aug10002007 at hq.af.mil> mitch at hq.af.mil (Mitch Wright)
writes:
>Does anyone have an idea exactly what [waitpid()] does?

waitpid() is a POSIX function:

	int waitpid(int pid, int *status, int options)

where the `pid' argument is the process ID of the process to wait
for, or WAIT_ANY to wait for any child; `status' is the place to
store the exit status (or signal); and `options' are options from
the same set allowed by 4.[123]BSD wait3(): WNOHANG: return 0 if
there are no exited children at the moment; and WUNTRACED: return
information on stopped children even when they are not being traced
via ptrace().

waitpid() allows routines like pclose() to operate reliably (i.e.,
without consuming any `wrong' child status).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris
	(New campus phone system, active sometime soon: +1 301 405 2750)



More information about the Comp.unix.wizards mailing list