wwaaiittppiidd() -- System Call (libc)

Wait for a process to terminate
#iinncclluuddee <ssyyss/ttyyppeess.hh>
#iinncclluuddee <ssyyss/wwaaiitt.hh>
ppiidd_tt wwaaiittppiidd(_p_i_d,_s_t_a_t_u_s, _f_l_a_g_s)
ppiidd_tt _p_i_d; iinntt *_s_t_a_t_u_s, _f_l_a_g_s;

wwaaiittppiidd() waits until a given process terminates.  _p_i_d identifies the child
process whose  termination is awaited.  The value of  _p_i_d sets the behavior
of wwaaiittppiidd(), as follows:

_p_i_d>0
     Wait for the termination of the child process whose identifier is _p_i_d.

_p_i_d=0
     Wait for the termination of any child in the current process group.

_p_i_d=-1
     Wait  for  the  termination  of  any  child process.   In  this  mode,
     wwaaiittppiidd() behaves the same as the system call wwaaiitt().

_p_i_d<-1
     Wait for termination of any child in the group given by -_p_i_d.

_s_t_a_t_u_s  points  to  the  place  where  you  want  wwaaiittppiidd()  to  write  the
termination status of _p_i_d.

_f_l_a_g_s is the logical OR of the following values:

WWNNOOHHAANNGG
     If  _p_i_d has  already  terminated, write  its  termination status  into
     _s_t_a_t_u_s; but  if _p_i_d has not  yet terminated, do not wait  for it to do
     so.

WWUUNNTTRRAACCEEDD
     Report the status  of every child process of _p_i_d  that is stopped, and
     whose status has not been returned since it stopped.

By default,  wwaaiittppiidd() returns the  process identifier of  the chid process
whose status  is being reported, or  -1 if something went  wrong.  If _f_l_a_g_s
includes  WWNNOOHHAANNGG,  wwaaiittppiidd()  returns zero  if  no  status information  is
available.

_S_e_e _A_l_s_o
lliibbcc, wwaaiitt(), wwaaiitt.hh
POSIX Standard, section 3.2.1
