exit.
, , .
䳿:
.
.
wait, wait , , 8 .
wait, .
, - 1. , (init).
, , SIGHUP. , .
SIGCHLD ( ). , .
6. wait, waitpid
wait, waitpid waitid , (, ) ..
waitpid -
# include <sys/wait.h>
pid_t waitpid (pid_t pid, int * statusp, int options)
pid-
statusp - NULL
options - ;
0, -1 ( errno)
pid
− :>0 .
− -1 - .
− 0 - , , .
− <-1 - , -pid.
waitpid - , , pid. , WNOHANG ( ).
, fork. - , ( ) . 볻 , -.
, - - - , . , , wait . , , .
|
|
waitpid ( ). : , . : , , ,
options , ' :
WEXITED ( waitpid, ).
WSTOPPED ( waitpid WUNTRACED).
WCONTINUED ( waitpid).
WNOHANG . - 0 ( waitpid).
WNOWAiT . , waitpid.