Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > Need help with your homework?
|
Need help with your homework? Need help with a homework question on any programming language? Post questions and help here, not in the language topic forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Need help with your homework? section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 22nd, 2008, 02:56 PM
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





Similar Threads
Thread Thread Starter Forum Replies Last Post
char* argv in main() - counting and termination proslambano BOOK: Ivor Horton's Beginning Visual C++ 2005 1 March 14th, 2007 04:33 PM
char* argv to main - counting and termination proslambano C++ Programming 1 March 4th, 2007 01:22 AM
Code to run before termination of program shazia1 VS.NET 2002/2003 0 April 21st, 2006 03:42 AM
Termination!! Ibn_Aziz Forum and Wrox.com Feedback 2 September 7th, 2003 09:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.