title: How to get process's grandparent id
body: <p>How can i get process id of the current process's parent?<br>
  In general given a process id how can I get its parent process id?<br>
  e.g. os.getpid() can be used to get the proccess id, and os.getppid() for the parent, how do I get grandparent,</p>
  
  <p>My target is linux(ubuntu) so platform specific answers are ok.</p>