getppid()--Get Process ID of Parent Process


  Syntax
 #include <sys/types.h>
 #include <unistd.h>

 pid_t getppid(void);

  Service Program Name: QP0WSRV1

  Default Public Authority: *USE

  Threadsafe: Yes

The getppid() function returns the parent process ID of the calling process.


Parameters

None


Authorities

None.


Return Value

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.


Error Conditions

The getppid() function is always successful and does not return an error.


Related Information


Example

See Code disclaimer information for information pertaining to code examples.

For an example of using this function, see the child program in Using the Spawn Process and Wait for Child Process APIs



API introduced: V3R6
Top | UNIX-Type APIs | APIs by category