Go to the first, previous, next, last section, table of contents.


tcsetpgrp

Syntax

#include <termios.h>

int tcsetpgrp (int fd, pid_t pgroup_id);

Description

This function sets the foreground process group ID for the terminal connected to file descriptor fd. fd must be a valid handle connected to a terminal device, and pgroup_id must be the process group ID of the calling process, or the function will fail.

Return Value

If fd is a valid handle connected to a terminal and pgroup_id is equal to what getpgrp() returns (see section getpgrp), the function will do nothing and return zero. Otherwise, -1 will be returned and errno will be set to a suitable value. In particular, if the pgroup_id argument is different from what getpgrp() returns, tcsetpgrp sets errno to ENOSYS.

Portability

not ANSI, POSIX


Go to the first, previous, next, last section, table of contents.