100  3.  ++-   

 wait()      ,   -
     ,    ,    -
    .



#include <sys/wait.h>

pid_t wait(int *status) ;

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

 waitpid()   wait()   ,  
   pid  options.  pid  -
  ,     .  -
,   pid ,      .

pid > 0       .

pid = 0       ,    -
    .

pid < -1      ,    
  pid.

pid = -1      .

 options ,     ,
       ,   

<sys/wait.h>:

WCONTINUED       -
 (  pid),      -
     .

WUNTRACED         -
 (  pid),      -
    .

WNOHANG        ,   
   .

         
     options (, WCONTINUED | | WUNTRACED).

     (PID)  ,  -
   .  ,    status,
  0,  ,       :

    0   main ();

      exit ()   0;

   ,     .

 . 3.8  ,     -
 .