[Previous]
[Contents]
[Next]

getpgrp()

get the process group

Synopsis:

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

Description:

The getpgrp() function allows the calling process to find out which process group it belongs to.

Returns:

The calling process's process group ID.

Examples:

/*
 * Print the process group of this process.
 */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

void main()
  {
    printf( "I am in process group %d\n",
        ( int ) getpgrp() );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

setsid()


[Previous]
[Contents]
[Next]