Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (t - v) tcsetpgrp(3)
NAME
tcsetpgrp - Sets the foreground process group ID
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
int tcsetpgrp(
int filedes,
pid_t pgrp_id);
PARAMETERS
filedes Specifies an open file descriptor.
pgrp_id Specifies the process group ID.
DESCRIPTION
If the calling process has a controlling terminal, the tcsetpgrp( ) function sets the foreground pro-
cess group ID associated with the terminal to the value of the pgrp_id parameter. The file associ-
ated 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.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, the value -1 is returned
and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the tcsetpgrp( ) function sets errno to the correspond-
ing value:
[EBADF] The filedes parameter is not a valid file descriptor.
[EINVAL] The pgrp_id parameter is invalid.
[EISGUARDIAN]
The value used for the filedes parameter is appropriate only in the Guardian
environment.
[ENETDOWN]
The filedes parameter specifies a file in /E (a remote $ZTNT process) but com-
munication with the remote node has been lost.
[ENOTTY] One of the following conditions exists:
The calling process does not have a controlling terminal
The file is not the controlling terminal
The controlling terminal is no longer associated with the session of the
calling process.
527187-017 Hewlett-Packard Company 723