Operating System - HP-UX
1829117 Members
2082 Online
109986 Solutions
New Discussion

finding childs of a given parent process

 
Sup
Advisor

finding childs of a given parent process

Hi,

Is there any system call to get a list of
child pids for a given parent pid?

Thanx
2 REPLIES 2
Mike Stroyan
Honored Contributor

Re: finding childs of a given parent process

You can use pstat_getproc to list all processes, then sort out the ones you want by their parent process id data. See the attached example.
Bill Hassell
Honored Contributor

Re: finding childs of a given parent process

Another technique is to use the -H option for ps as in:

UNIX95= ps -f -H

The UNIX95= is required to turn on the -H (and -C and -o) options in ps. The -H option gives a complete hierarchy list for each parent.


Bill Hassell, sysadmin