Sets foreground process group ID.
Standard C Library (libc.a)
#include <unistd.h>
int tcsetpgrp ( FileDescriptor, ProcessGroupID)
int FileDescriptor;
pid_t ProcessGroupID;
If the process has a controlling terminal, the tcsetpgrp subroutine sets the foreground process group ID associated with the terminal to the value of the ProcessGroupID parameter. The file associated with the FileDescriptor parameter must be the controlling terminal of the calling process, and the controlling terminal must be currently associated with the session of the calling process. The value of the ProcessGroupID parameter must match a process group ID of a process in the same session as the calling process.
FileDescriptor | Specifies an open file descriptor. |
ProcessGroupID | Specifies the process group identifier. |
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
This function is unsuccessful if one of the following is true:
The tcgetpgrp (tcgetpgrp Subroutine) subroutine.
The Input and Output Handling Programmer's Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.