I have a C++ program where I'm trying to follow the parent process ID chain backward (parent of a parent, parent of a parent of a parent, etc...). The first step is easy - getppid() returns the process id of the immediate parent. After that, I'm stumped.
I'm currently developing in linux, and a workaround is to screen-scrape the output of the proc command. That works, but it's not portable (Macs either don't have proc or it's not universal).
Any ideas?