View Single Post
  #1 (permalink)  
Old February 22nd, 2008, 02:56 PM
anilchowdhury anilchowdhury is offline
Registered User
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anilchowdhury
Default zombie to exist after termination of main prog.

main()
{
pid_t child;
child=fork();

if(child > 0)

{sleep(60);
}

else
{exit(0);
}

}

the above code will create zombie process,which will be adopted by init as soon as parent process will dies.Can any one gimme a code or an algorithm to keep this zombie process alive even after its parent dies...i.e to stop init from adopting it after the termination of main programme

anil chowdhury
Reply With Quote