Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

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 OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
int tcsetpgrp(
int ledes,
pid_t pgrp_id);
PARAMETERS
filedes Species an open le descriptor.
pgrp_id Species 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 le associ-
ated with the ledes 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 ledes parameter is not a valid le descriptor.
[EINVAL] The pgrp_id parameter is invalid.
[EISGUARDIAN]
The value used for the ledes parameter is appropriate only in the Guardian
environment.
[ENETDOWN]
The ledes parameter species a le 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 le is not the controlling terminal
The controlling terminal is no longer associated with the session of the
calling process.
527187-004 Hewlett-Packard Company 719