Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
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 and J-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
pid_t tcgetpgrp(
int filedes);
PARAMETERS
filedes Indicates the open file descriptor for the terminal special file.
DESCRIPTION
The tcgetpgrp( ) function returns the value of the process group ID of the foreground process
group associated with the terminal indicated by the filedes 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 filedes parameter is not a valid file descriptor.
[EISGUARDIAN]
The value used for the filedes parameter is appropriate only in the Guardian
environment.
[ENETDOWN]
The filedes parameter specifies a file 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 specified termi-
nal file 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 define. The following
features are affected in the HP implementation:
• The tcgetpgrp( ) function supports the behavior defined for values of
_POSIX_JOB_CONTROL other than -1.
The following are HP extensions to the XPG4 Version 2 specification:
527187-017 Hewlett-Packard Company 7−17