TCSETPGRP(3P) TCSETPGRP(3P)
NAME
tcsetpgrp - set distinguished process group ID
SYNOPSIS
#include <termios.h>
int tcsetpgrp(fildes,pgrpid)
int fildes;
int pgrpid;
DESCRIPTION
If the process has a controlling terminal, tcsetpgrp will
set the distinguished process group ID associated with the
terminal to pgrpid. The file associated with fildes must
be the controlling terminal of the calling process. There
must be at least one process in pgrpid that has the same
controlling terminal as the calling process.
tcsetpgrp is part of the POSIX Job Control Option.
RETURN VALUE
Upon successful completion, tcsetpgrp returns zero.
Otherwise, -1 is returned and errno is set to indicate the
error.
ERRORS
[EBADF] fildes is not a valid file descriptor.
[EINVAL] tcsetpgrp is not permitted for the device
associated with fildes or the value of pgrpid is
less than or equal to zero or exceeds {PIDMAX}.
[ENOTTY] The calling process does not have a controlling
terminal or the file is not the controlling
terminal.
[EPERM] pgrpid is greater than zero and less than or
equal to {PIDMAX}, but does not match the process
group ID of a process in the same session as the
calling process.
Page 1 May 1989
TCSETPGRP(3P) TCSETPGRP(3P)
SEE ALSO
setpgrp(2), setpgid(2), tcgetpgrp(3P).
Page 2 May 1989