tcgetpgrp()

get process group ID of terminal foreground terminal process group 

Function


SYNOPSIS

#include <sys/types.h>

#include <unistd.h>

pid_t tcgetpgrp(int fildes);


DESCRIPTION

The tcgetpgrp() function returns the value of the process group ID of the foreground process group associated with the terminal.


PARAMETERS

fildes 

Is the file descriptor, which must refer to a terminal.


RETURN VALUES

If successful, tcgetpgrp() returns the process group ID of the foreground process group associated with the terminal. If there is no foreground process group, tcgetpgrp() returns a value greater than 1 that does not match the process group ID of any existing process group. Otherwise, it returns -1 and sets errno one of the following values:

EBADF 

The fildes parameter is not a valid file descriptor.

ENOTTY 

The calling process does not have a controlling terminal, or the file is not the controlling terminal.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

Async-signals-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
setpgid(), setsid(), tcsetpgrp()


PTC MKS Toolkit 10.3 Documentation Build 39.