Originally Posted by shatmanyu
Can anybody plz suggest me How to create a c program for an Orphan
I just need a simple example ...
You just need to understand the meaning of an orphan process.
If parent process is dead but its child process is alive, the child process is declared orphan, means it is now adopted by its new parent .. the init process.
to create the processes, kill the parent (its pid will be known to you through getpid()
), and your program will have a orphan process..