When a child process complete the execution before the parent process exits, which of the following is correct? the child process becomes defunct the parent process becomes defunct the child process becomes a zombie All of the above code example
Example: reap zombie process in c
void delete_zombies(void)
{
pid_t kidpid;
int status;
printf("Inside zombie deleter: ");
while ((kidpid = waitpid(-1, &status, WNOHANG)) > 0)
{
printf("Child %ld terminated\n", kidpid);
}
siglongjmp(env,1);
}