rustix::termios

Function tcgetattr

source
pub fn tcgetattr<Fd: AsFd>(fd: Fd) -> Result<Termios>
Expand description

tcgetattr(fd)—Get terminal attributes.

Also known as the TCGETS (or TCGETS2 on Linux) operation with ioctl.

On Linux, this uses TCGETS2. If that fails in a way that indicates that the host doesn’t support it, this falls back to the old TCGETS, manually initializes the fields that TCGETS doesn’t initialize, and fails with io::Errno::RANGE if the input or output speeds cannot be supported.

§References