How to find the name of the parent process?

Hi,
I am currently programming in C++ under Linux. I have written a software that can be executed by different processes. In one case I have to implement a specific sequence. So to know if I have or not to perform this sequence I am trying to find the name of the parent process.

My problem is that I do not find the function for this. I am able to obtain the PID of the parent (by getppid). But I do not know how to obtain its name.

I do not want to use the /proc/<pid> because my software must be able to run on different platforms (Ubuntu, CentOS, HP-UX, ...).

Thanks for your help
Last edited on
Topic archived. No new replies allowed.