tcgetpgrp(3P) tcgetpgrp(3P)NAME tcgetpgrp - gets distinguished process group ID SYNOPSIS #include <sys/types.h> pid_t tcgetpgrp(fildes) int fildes; DESCRIPTION tcgetpgrp is part of the POSIX Job Control option. tcgetpgrp returns the value of the process group ID of the foreground process group associated with the terminal. tcgetpgrp may be called 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. STATUS MESSAGES AND VALUES On successful completion, tcgetpgrp returns the process group ID of the foreground process group associated with the terminal. Otherwise, -1 is returned and errno is set to indicate the error. If any of the following conditions occur, tcgetpgrp will return -1 and set errno to the corresponding value. EBADF The file descriptor fildes is not valid. EINVAL tcgetpgrp is not permitted for the device associated with fildes. ENOTTY The calling process does not have a controlling terminal, or the file is not the controlling terminal. SEE ALSO setpgid(2P), setsid(2P), tcsetpgrp(3P) January 1992 1