zombies

pkodl at ra.rockwell.com pkodl at ra.rockwell.com
Fri Oct 23 10:29:27 CEST 1998


>Poradi mi nekdo, jak se zbavit zombies ?
>Zkousim si udelat komunikaci server/client na TCP/IP. Server mi chodi,
>ale po childs zustavaji zombies. Uz jsem tam dal za fork() i
>waitpid(pid), ukoncuji childs pres exit(0), ale nezabralo to. Rad bych
>vedel, kde delam chybu a proc se ti zombaci objevuji.

(to neni z moji hlavy, ale z Internetworking with TCP/IP, Client-Server
Programming and Applications, Prentice-Hall, ISBN 0-13-474222-2 )

==========
Unix sends a signal to parent whenever child process exits. The child
process remains in
zombie state until parent executes wait3 system call.

/* in parent init section*/
signal(SIGCHLD,killer);


int killer()
{
     union wait status;
     while( 0 <= wait3(&status,WNOHANG,(struct rusage *)0) );
}

Snad to pomuze

pecold





More information about the Users-l mailing list