tcsetpgrp
if (ttyfd >= 0 && tcsetpgrp(ttyfd, rootpid) < 0)
tcsetpgrp(ttyfd, rootpid);
tcsetpgrp(ttyfd, initialpgrp);
tcsetpgrp(ttyfd, pgrp);
if (tcsetpgrp(ttyfd, pgrp) < 0)
int tcsetpgrp(int, pid_t);
int tcsetpgrp(int, pid_t);
if (tcsetpgrp(fd, getpid()) < 0)
if (tcsetpgrp(fd, getpid()) < 0) {
tcsetpgrp(STDERR_FILENO, child_pid);
tcsetpgrp(STDERR_FILENO, getpgrp());
tcsetpgrp(STDERR_FILENO, child_pgrp);
tcsetpgrp(STDERR_FILENO, getpgrp());
if (tcsetpgrp(0, getpid()) < 0) {