tcgetpgrp(3) — Subroutines
OSF
NAME
tcgetpgrp − Gets foreground process group ID
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <sys/types.h>
pid_t tcgetpgrp(
int file_des);
PARAMETERS
file_des
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. The function can be called from a background process; however, the information may be subsequently changed by the foreground process.
NOTES
AES Support Level: Full use
RETURN VALUES
Upon successful completion, the process group ID of the foreground process is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
If the tcgetpgrp() function fails, errno may be set to one of the following values:
[EBADF] The file_des 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.
RELATED INFORMATION
Functions: setpgid(2), setsid(2), tcsetpgrp(3)