


      WWWWAAAAIIIITTTT((((2222))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    WWWWAAAAIIIITTTT((((2222))))



      NNNNAAAAMMMMEEEE
           wait - wait for child process to stop or terminate

      SSSSYYYYNNNNTTTTAAAAXXXX
           iiiinnnntttt wwwwaaaaiiiitttt ((((ssssttttaaaatttt____lllloooocccc)))) iiiinnnntttt ****ssssttttaaaatttt____lllloooocccc;;;;
           iiiinnnntttt wwwwaaaaiiiitttt ((((((((iiiinnnntttt ****))))0000))))

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _W_a_i_t suspends the calling process until it receives a signal
           that is to be caught (see _s_i_g_n_a_l(2)), or until one of the
           calling process's child processes stops in a trace mode (see
           _p_t_r_a_c_e(2)), or terminates. If a child process stopped or
           terminated prior to the call on _w_a_i_t, return is immediate.

           If _s_t_a_t__l_o_c (taken as an integer) is non-zero, 16 bits of
           information called "status" are stored in the low-order bits
           of the location pointed to by _s_t_a_t__l_o_c. _S_t_a_t_u_s can be used
           to differentiate between stopped and terminated child
           processes and, if the child process terminated, status
           identifies the cause of termination and passes useful
           information to the parent. This is accomplished as follows:

                If the child process stopped, the high-order eight bits
                of status will contain the number of the signal that
                caused the process to stop and the low-order eight bits
                of the argument that the child process passed to _e_x_i_t
                (see _e_x_i_t(2))

                If the child process terminated due to an _e_x_i_t call,
                the low-order eight bits of status will be zero and the
                high-order eight bits will contain the low-order eight
                bits of the argument that the child process passed to
                _e_x_i_t (see _e_x_i_t(2)).

                If the child process terminted due to a signal, the
                high-order eight bits of status will be zero and the
                low-order eight bits will contain the number of the
                signal that caused the termination. In addition, if the
                low-order seventh bit (i.e., bit 200) is set, a ``core
                image'' will have been produced (see _s_i_g_n_a_l(2)).

           If a parent process terminates without waiting for its child
           processes to terminate, the parent process ID of each child
           process is set to 1. This means the initialization process
           inherits the child processes (see _i_n_t_r_o(2)).

           _W_a_i_t will fail and return immediately if either or both of
           the following are true:

                The calling process has no existing unwaited-for child
                processes.  [ECHILD]




      Page 1                                                   (9010-E)






      WWWWAAAAIIIITTTT((((2222))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    WWWWAAAAIIIITTTT((((2222))))



                _S_t_a_t__l_o_c points to an illegal address.  [EFAULT]

      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
           If _w_a_i_t returns due to the receipt of a signal, a value of
           -1 is returned to the calling process and _e_r_n_o is set to
           EINTR. If _w_a_i_t returns due to a stopped or terminated child
           process, the process ID of the child is returned to the
           calling process. Otherwise, a value of -1 is returned and
           _e_r_r_n_o is set to indicate the error.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           exec(2), exit(2), fork(2), pause(2), signal(2).

      WWWWAAAARRRRNNNNIIIINNNNGGGG
           See _W_A_R_N_I_N_G in _s_i_g_n_a_l(2).








































      Page 2                                                   (9010-E)



