tcsetpgrp(3)

DESCRIPTION

Makes pgrp the foreground process group of the terminal referred to by fd.

SYNOPSIS

#include <unistd.h>

int tcsetpgrp(int fd, int pgrp);

RETURN VALUE

  • Returns zero, or -1 and sets errno.

ERRORS

  • -EBADF
    • Fd does not refer to an open descriptor.
  • -EPERM
    • Pgrp is nonpositive or is not a process group in the caller's session.
  • -ENOTTY
    • Fd is not a terminal.

NOTES

The wrapper uses TIOCGPGRP/TIOCSPGRP through ioctl. The target group must exist in the caller's session.