Quote: |
Originally Posted by mohit dhawan i think the child dies only if it shares the same process space as the parent | No.
Linux implements fork() as "copy-on-write" - most modern Unices do it the same way..
So, as long as you don't do exec() after fork(), both the processes still share the proc space.
Even then, when the parent terminates (without explicitly killing the child), the child is inherited by init (pid 1) - as was told by scm.
You can find the detailed discussion of this topic in W. Richard Stevens' "Advanced Programming in the Unix environment" and Maurice J. Bach's "The design of the UNIX operating system".
__________________
The Unforgiven
Registered Linux User #358564
|