You should already have the PID of the child process, the fork () man page says:
If successful, the PID of the child process is returned in the parent, and 0 is returned in the child.
So, in the child process you find 0 and run your program, in the parent pid there will be the actual PID of the child.
, , , xdg-open, PID, , PID .
, , , , โโ ps pgrep. , PID , xdg-open.