Find the answer to your Linux question:
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 ...
  1. #1
    Just 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

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    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!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...