자식 프로세스가 죽을때 장례치러주는 코드입니다.
[code:1]void SigHandler( int signo )
{
int n;
waitpid( -1, &n, 0 );
return;
}
int main( void )
{
struct sigaction act;
act.sa_handler = SigHandler;
act.sa_flags = 0;
sigemptyset( &act.sa_mask );
sigaction( SIGCHLD, &act, NULL );
while( 1 )
{
int PID;
if( 어떤 이벤트 발생시 )
{
PID = fork();
if( PID == 0 )