tcgetpgrp(3P) tcgetpgrp(3P)NAME tcgetpgrp - get 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. RETURN VALUE 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 in- dicate the error. ERRORS If any of the following conditions occur, tcgetpgrp will re- turn -1 and set errno to the corresponding value. [EBADF] The file descriptor fildes is not valid. [EINVAL] tcgetpgrp is not permitted for the device as- sociated with fildes. [ENOTTY] The calling process does not have a control- ling terminal, or the file is not the control- ling terminal. SEE ALSO setsid(2P), setpgid(2P), tcsetpgrp(3P). April, 1990 1