[Previous]
[Contents]
[Next]

getppid()

get the parent process ID

Synopsis:

#include <sys/types.h>
#include <unistd.h>
pid_t getppid( void );

Description:

The getppid() function allows the calling process to find out its parent's identity.

Returns:

The calling process's parent's process ID.

Examples:

/*
 * Print the parent's process ID.
 */
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

void main()
  {
    printf( "My parent is %d\n", getppid() );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

getpid()


[Previous]
[Contents]
[Next]