devela::_dep::rustix::termios

Function tcgetpgrp

pub fn tcgetpgrp<Fd>(fd: Fd) -> Result<Pid, Errno> 
where Fd: AsFd,
Available on crate feature dep_rustix only.
Expand description

tcgetpgrp(fd)—Get the terminal foreground process group.

Also known as the TIOCGPGRP operation with ioctl.

On Linux, if fd is a pseudo-terminal, the underlying system call here can return a pid of 0, which rustix’s Pid type doesn’t support. So rustix instead handles this case by failing with io::Errno::OPNOTSUPP if the pid is 0.

§References