b***@gmail.com
2007-01-31 02:04:34 UTC
Hi,
I read the Unix Programming Faq, there are some statements on how to
prevent zombie process,
1.6.2 How do I prevent them from occuring?
------------------------------------------
Another approach is to `fork()' *twice*, and have the immediate child
process exit straight away. This causes the grandchild process to be
orphaned, so the init process is responsible for cleaning it up. For
code
to do this, see the function `fork2()' in the examples section.
anyone can tell me why fork twice is needed?
thanks
I read the Unix Programming Faq, there are some statements on how to
prevent zombie process,
1.6.2 How do I prevent them from occuring?
------------------------------------------
Another approach is to `fork()' *twice*, and have the immediate child
process exit straight away. This causes the grandchild process to be
orphaned, so the init process is responsible for cleaning it up. For
code
to do this, see the function `fork2()' in the examples section.
anyone can tell me why fork twice is needed?
thanks