#include <sys/types.h> #include <unistd.h> pid_t getppid(void);
The getppid() function returns the parent process ID of the calling process.
None.
None..
pid_t | The value returned by getppid() is the process ID of the parent process for the calling process. A process ID value of 1 indicates that there is no parent process associated with the calling process. |
The getppid() function is always successful and does not return an error.
For an example of using this function, see the child program in Example: Using process-related APIs.