Linux how to check if parent process exists?

In linux we can access process parent like this:


my question is how can we check if the parent still exists?

The reason is that I am implementing a loop that visits all ancestors of current process and want to know when to stop.

Read more here:

Content Attribution

This content was originally published by DANIEL at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: