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.

See also:

getpid()

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

Systems:

QNX