Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcgetpgrp.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcgetpgrp.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcgetpgrp.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcgetpgrp.html on line 8

tcgetpgrp()

Get the process group ID associated with a device

Synopsis:

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

pid_t tcgetpgrp( int fildes );

Arguments:

fildes
A file descriptor that's associated with the device whose process group ID you want to get.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

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>
#include <stdlib.h>

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

Classification:

POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

signal(), tcsetpgrp()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcgetpgrp.html on line 152

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/tcgetpgrp.html on line 152