Getting a child and child's child process-id

Getting a child and child's child process-id

Post by Bruce Momji » Fri, 15 May 1992 10:15:13

I have a program that forks, creating a child, and this child forks
again, creating a child of its own.  Both child and sub-child continue
running for the life of the program.

I need for the main parent program to have the process-id of its child
(that's easy), and the process-id of the child's child.

The only way I can figure out how to do this is to create an unnamed
pipe befor the first child is created, and have the child's child write
its process-id into the pipe.

This seems like alot of overhead for one integer to be passed.  

Is there another way?  I am running on SVr3.1.

Bruce Momjian           | 830 Blythe Avenue               | home: (215)853-3000