Function ttyname

fn ttyname<F: std::os::fd::AsFd>(fd: F) -> Result<PathBuf>

Get the name of the terminal device that is open on file descriptor fd (see ttyname(3)).