C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-22-2008, 12:35 PM   #1
Registered User
 
Join Date: Feb 2008
Posts: 1
zombie to exist after the termination of main program..

Code:
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 alogrithm to keep this zombie proocess alive even after its parent dies...i.e to stop init from adopting it after the termination of main programme
anilchowdhury is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem comparing variables from my main program into my subprogram Raschoc C++ Programming 4 03-16-2009 08:44 AM
Abnormal program termination Kayoss C++ Programming 3 05-16-2006 03:29 PM
C program without main() satish_ram C Programming 5 09-18-2001 06:24 AM


All times are GMT -6. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22