NAME
tcgetpgrp — get
the foreground process group ID
SYNOPSIS
#include
<unistd.h>
pid_t tcgetpgrp(int fildes);
DESCRIPTION
The tcgetpgrp () function shall return the
value of the process group ID of the foreground process group associated
with the terminal.
If there is no foreground process group,
tcgetpgrp () shall return a value greater than 1
that does not match the process group ID of any existing process group.
The tcgetpgrp () function is allowed from
a process that is a member of a background process group; however, the
information may be subsequently changed by a process that is a member of a
foreground process group.
RETURN VALUE
Upon successful completion, tcgetpgrp ()
shall return the value of the process group ID of the foreground process
associated with the terminal. Otherwise, -1 shall be returned and
errno
set to indicate the error.
ERRORS
The tcgetpgrp () function shall fail
if:
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
setsid(3) , setpgid(3) , tcsetpgrp(3)
XBD <sys/types.h> , <unistd.h>
CHANGE HISTORY
First released in Issue 3. Included for alignment with the POSIX.1-1988 standard.
Issue 6
In the SYNOPSIS, the optional include of the <sys/types.h> header is removed.
The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:
- The requirement to include <sys/types.h> has been removed. Although <sys/types.h> was required for conforming implementations of previous POSIX specifications, it was not required for UNIX applications.
- In the DESCRIPTION, text previously conditional on support for _POSIX_JOB_CONTROL is now mandatory. This is a FIPS requirement.