in reply to Re^2: Function to get a child pid
in thread Function to get a child pid

Maybe I wasn't clear, and I apologize for that... I wasn't suggesting fork as a function "to get a child pid of a process running, by just passing only the parent process pid". Because I can hardly make sense of such a request.

Said this, maybe you just want to get a list of all the childs of a given (parent) process. If so, then you may use Proc::ProcessTable to search amongst all processes those that are childs of the given parent. You will be particularly interested in Proc::ProcessTable::Process's ppid() method.

To put all this together is left as an exercise to the reader.