getppid
Returns the process ID of the parent process. On the typical Unix system, if your parent process ID changes to 1 , your parent process has died and you've been adopted by the init program.
1
Copyright © 2001 O'Reilly & Associates. All rights reserved.