getppidx Kernel Service
Purpose
Gets the parent process ID of the specified process.
Syntax
#include <sys/types.h>
#include <sys/errno.h>
pid_t getppidx (ProcessID)
pid_t ProcessID;
pid_t ProcessID;
Parameter
Item | Description |
---|---|
ProcessID | Specifies the process ID. If this parameter is 0, then the parent process ID of the calling process is returned. |
Description
The getppidx() kernel service accepts a process ID as an input. If the input process ID is 0, the getppidx() subroutine returns the process ID of the calling process' parent process. If the input process ID is nonzero and a valid value, the parent ID of the input process ID is returned. If the input process ID is invalid, the getppidx() kernel service returns -1.
Execution Environment
The getppidx() kernel service can be called from the process environment only.
Return Values
Item | Description |
---|---|
-1 | Indicates that the ProcessID parameter is invalid. |