tcsetpgrp(3) — Subroutines
OSF
NAME
tcsetpgrp − Sets foreground process group ID
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <sys/types.h>
int tcsetpgrp(
int filedes,
pid_t pgrp_id );
PARAMETERS
filedes Specifies an open file descriptor.
pgrp_id
Specifies the process group identifier.
DESCRIPTION
If the process has a controlling terminal, the tcsetpgrp() function sets the foreground process group ID associated with the terminal to the value of the pgrp_id parameter. The file associated with the filedes 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 pgrp_id parameter must match a process group ID of a process in the same session as the calling process.
NOTES
AES Support Level: Full use
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
If the tcsetpgrp() function fails, errno may be set to one of the following values:
[EBADF] The filedes parameter is not a valid file descriptor.
[EINVAL] The pgrp_id parameter is invalid.
[ENOTTY] The calling process does not have a controlling terminal, the file is not the controlling terminal, or the controlling terminal is no longer associated with the session of the calling process.
[EPERM] The pgrp_id parameter is valid, but matches a process ID or process group ID of a process in another session.
RELATED INFORMATION
Functions: tcgetpgrp(3)