There is no standard Unix API for retrieving the list of child processes of this process.
You can list all the processes in the system with their parent process and build a process tree from this. A portable way to do this is to run a command
ps -e -o ppid= -o pid=
(popen, scanf("%ld %ld\n")). PPID PID, , .
- , , . , , PID , . , P Q, R, Q , R PPID 1, , R P.
: , , , .
Unix : . , , . signal_number kill(-pgid, signal_number).
, , , , , . setsid setpgid, .