Results 1 to 2 of 2
Hi All,
What are the different ways to prevent zombie?
I am totally confused about using:
a) wait system call
b) waitpid system call
c) using signals - signal handler ...
- 07-23-2009 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 6
To prevent Zombie
Hi All,
What are the different ways to prevent zombie?
I am totally confused about using:
a) wait system call
b) waitpid system call
c) using signals - signal handler for SIGCHLD with SIG_IGN and sigaction system call
for handling zombies ???
thanx
- 07-23-2009 #2
Wait and waitpid do the same thing: they wait until a child terminates and then collect its exit information. Wait waits until any child terminates, waitpid does it for the child with the specified PID. This is default behaviour; you can set a NOHANG flag so that the process doesn't actually wait but only checks if a child has terminated and then returns.
The process also gets a SIGCHILD when a child dies and can act on it but I don't think there is any way of collecting the exit information of the child except by way of wait/waitpid and, without this information being collected, the child will become a zombie."I'm just a little old lady; don't try to dazzle me with jargon!"


Reply With Quote