Gets foreground process group ID.
Standard C Library (libc.a)
pid_t tcgetpgrp (FileDescriptor) int FileDescriptor;
The tcgetpgrp subroutine 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 foreground process can subsequently change the information.
|FileDescriptor||Indicates the open file descriptor for the terminal special file.|
Upon successful completion, the process group ID of the foreground process is returned. If there is no foreground process group, a value greater than 1 that does not match the process group ID of any existing process group is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The tcgetpgrp subroutine is unsuccessful if one of the following is true:
|EBADF||The FileDescriptor argument is not a valid file descriptor.|
|EINVAL||The function is not appropriate for the file associated with the FileDescriptor argument.|
|ENOTTY||The calling process does not have a controlling terminal or the file is not the controlling terminal.|
This subroutine is part of Base Operating System (BOS) Runtime.
The setpgid subroutine, setsid subroutine, tcsetpgrp subroutine.
The Input and Output Handling Programmer's Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.