Thread: Fork => zombie => error

  1. #1
    Registered User
    Join Date
    Oct 2005

    Fork => zombie => error

    pid = fork();
    		if (pid < 0){ error("Error: Cannot create new proces"); return EXIT_FAILURE;}
    		if (pid == 0)  {
    			return EXIT_SUCCESS;
    Now the problem is that if this process runs for a week or so it has forked so many times that the ps aux list is full of zombies.

    I used to know how to deal with zombies but i seem to have forgotten it. Please help me. The parent doen't need any information of the child when te child ends? So how do I prevent that the child turn into a zombie after the child dies.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    You might not need any information, but you still have to call one of the wait() functions to cause the zombie to finally disappear from the process table.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Getting other processes class names
    By Hawkin in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2008, 04:02 PM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM