Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

OSS Library Calls (t - v) tcgetpgrp(3)
NAME
tcgetpgrp - Gets the foreground process group ID
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
pid_t tcgetpgrp(
int ledes);
PARAMETERS
filedes Indicates the open le descriptor for the terminal special le.
DESCRIPTION
The tcgetpgrp() function returns the value of the process group ID of the foreground process
group associated with the terminal indicated by the ledes parameter. The function can be called
from a background process; however, the information might be subsequently changed by the
foreground process.
RETURN VALUES
Upon successful completion, the process group ID of the foreground process is returned. When
no foreground process group exists, the call returns a value greater than 1 that does not match the
process group ID of any existing process group.
If the call does not complete successfully, the value -1 is returned and errno is set to indicate the
error.
ERRORS
If any of the following conditions occurs, the tcgetpgrp() function sets errno to the correspond-
ing value:
[EBADF] The ledes parameter is not a valid le descriptor.
[EISGUARDIAN]
The value used for the ledes parameter is appropriate only in the Guardian
environment.
[ENETDOWN]
The ledes parameter species a le in /E (a remote $ZTNT process) but com-
munication with the remote node has been lost.
[ENOTTY] The calling process does not have a controlling terminal, or the specied termi-
nal le is not the controlling terminal.
RELATED INFORMATION
Functions: setpgid(2), setsid(2), tcsetpgrp(3).
STANDARDS CONFORMANCE
The POSIX standards leave some things to the implementing vendor to dene. The following
features are affected in the HP implementation:
The tcgetpgrp() function supports the behavior dened for values of
_POSIX_JOB_CONTROL other than -1.
The following are HP extensions to the XPG4 Version 2 specication:
527187-004 Hewlett-Packard Company 713