Linux how to check if parent process exists?

In linux we can access process parent like this:

current->parent

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: https://stackoverflow.com/questions/67479784/linux-how-to-check-if-parent-process-exists

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: