[Previous]
[Contents]
[Next]

tcgetpgrp()

get the process group ID associated with a device

Synopsis:

#include <sys/types.h>
#include <unistd.h>
pid_t tcgetpgrp( int fildes );

Description:

The tcgetpgrp() function returns the process group ID of the foreground process that's associated with the device indicated by fildes.

Returns:

The ID of foreground process group. If an error occurs, -1 is returned and errno is set.

Errors:

EBADF
The argument fildes is invalid.
ENOSYS
The resource manager associated with fildes doesn't support this call.
ENOTTY
The argument fildes isn't associated with a terminal device.

Examples:

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

void main()
  {
    printf( "STDIN directs breaks to pgrp %d\n",
        tcgetpgrp( 0 ) );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

errno, signal(), tcsetct(), tcsetpgrp()


[Previous]
[Contents]
[Next]