I know getppid retrieves the parent pid of the underlying program, but how can you tell this out of that program? I can’t find anything useful in /proc/[pid], or is there any useful API that i can use?
UPDATE
I mean , i’m inspecting these procress with another process , so getppid won’t work here
It is the fourth field in /proc/[pid]/stat. It is documented in the man page
proc(5).