diff options
Diffstat (limited to 'vendor/rustix/src/termios')
-rw-r--r-- | vendor/rustix/src/termios/constants.rs | 799 | ||||
-rw-r--r-- | vendor/rustix/src/termios/mod.rs | 781 | ||||
-rw-r--r-- | vendor/rustix/src/termios/tc.rs | 80 |
3 files changed, 108 insertions, 1552 deletions
diff --git a/vendor/rustix/src/termios/constants.rs b/vendor/rustix/src/termios/constants.rs index e96f139eb..99b75c06e 100644 --- a/vendor/rustix/src/termios/constants.rs +++ b/vendor/rustix/src/termios/constants.rs @@ -1,692 +1,10 @@ use crate::backend; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B1000000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B1152000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B1500000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B2000000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B2500000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B3000000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B3500000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B4000000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "openbsd" -)))] -pub use backend::termios::types::B460800; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B500000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::B576000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "openbsd" -)))] -pub use backend::termios::types::B921600; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::BRKINT; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::BS0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::BS1; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::BSDLY; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", -)))] -pub use backend::termios::types::CBAUD; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CBAUDEX; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", -)))] -pub use backend::termios::types::CIBAUD; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CLOCAL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CMSPAR; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CR0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CR1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CR2; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CR3; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::CRDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CREAD; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::CRTSCTS; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CS5; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CS6; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CS7; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CS8; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CSIZE; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::CSTOPB; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ECHO; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::ECHOCTL; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ECHOE; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ECHOK; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::ECHOKE; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ECHONL; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::ECHOPRT; -#[cfg(not(any( - target_os = "emscripten", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::EXTA; -#[cfg(not(any( - target_os = "emscripten", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::EXTB; -#[cfg(not(any( - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "redox" -)))] -pub use backend::termios::types::EXTPROC; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::FF0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::FF1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::FFDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::FLUSHO; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::HUPCL; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ICRNL; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::IEXTEN; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::IGNBRK; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::IGNCR; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::IGNPAR; -#[cfg(not(any( - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "redox" -)))] -pub use backend::termios::types::IMAXBEL; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::INLCR; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::INPCK; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ISIG; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ISTRIP; -#[cfg(any( - linux_raw, - all( - libc, - any(target_os = "haiku", target_os = "illumos", target_os = "solaris"), - ) -))] -pub use backend::termios::types::IUCLC; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::IUTF8; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::IXANY; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::IXOFF; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::IXON; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::NL0; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::NL1; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::NLDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::NOFLSH; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::OCRNL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", -)))] -pub use backend::termios::types::OFDEL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", -)))] -pub use backend::termios::types::OFILL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "redox", -)))] -pub use backend::termios::types::OLCUC; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ONLCR; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ONLRET; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::ONOCR; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::OPOST; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::PARENB; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::PARMRK; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::PARODD; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] -pub use backend::termios::types::PENDIN; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::TAB0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::TAB1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::TAB2; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::TAB3; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "illumos", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::TABDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos")))] -pub use backend::termios::types::TOSTOP; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", -)))] -pub use backend::termios::types::VSWTC; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::VT0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::VT1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::VTDLY; -#[cfg(any(linux_raw, all(libc, any(target_arch = "s390x", target_os = "haiku"))))] -pub use backend::termios::types::XCASE; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", -)))] -pub use backend::termios::types::XTABS; -pub use backend::termios::types::{ - B0, B110, B115200, B1200, B134, B150, B1800, B19200, B200, B230400, B2400, B300, B38400, B4800, - B50, B57600, B600, B75, B9600, ICANON, VEOF, VEOL, VEOL2, VERASE, VINTR, VKILL, VMIN, VQUIT, - VSTART, VSTOP, VSUSP, VTIME, -}; -#[cfg(not(target_os = "haiku"))] -pub use backend::termios::types::{VDISCARD, VLNEXT, VREPRINT, VWERASE}; + +pub use backend::termios::types::*; /// Translate from a `Speed` code to a speed value `u32`. /// -/// ```rust +/// ``` /// let speed = rustix::termios::speed_value(rustix::termios::B57600); /// assert_eq!(speed, Some(57600)); /// ``` @@ -708,142 +26,73 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option<u32> { backend::termios::types::B9600 => Some(9600), backend::termios::types::B19200 => Some(19200), backend::termios::types::B38400 => Some(38400), + #[cfg(not(target_os = "aix"))] backend::termios::types::B57600 => Some(57600), + #[cfg(not(target_os = "aix"))] backend::termios::types::B115200 => Some(115_200), + #[cfg(not(target_os = "aix"))] backend::termios::types::B230400 => Some(230_400), #[cfg(not(any( + apple, + target_os = "aix", target_os = "dragonfly", target_os = "haiku", - target_os = "ios", - target_os = "macos", target_os = "openbsd" )))] backend::termios::types::B460800 => Some(460_800), - #[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - )))] + #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))] backend::termios::types::B500000 => Some(500_000), - #[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - )))] + #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))] backend::termios::types::B576000 => Some(576_000), #[cfg(not(any( + apple, + target_os = "aix", target_os = "dragonfly", target_os = "haiku", - target_os = "ios", - target_os = "macos", target_os = "openbsd" )))] backend::termios::types::B921600 => Some(921_600), - #[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - )))] + #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))] backend::termios::types::B1000000 => Some(1_000_000), - #[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - )))] + #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))] backend::termios::types::B1152000 => Some(1_152_000), - #[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - )))] + #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))] backend::termios::types::B1500000 => Some(1_500_000), - #[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - )))] + #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))] backend::termios::types::B2000000 => Some(2_000_000), #[cfg(not(any( target_arch = "sparc", target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", + bsd, + target_os = "aix", target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", target_os = "solaris", )))] backend::termios::types::B2500000 => Some(2_500_000), #[cfg(not(any( target_arch = "sparc", target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", + bsd, + target_os = "aix", target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", target_os = "solaris", )))] backend::termios::types::B3000000 => Some(3_000_000), #[cfg(not(any( target_arch = "sparc", target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", + bsd, + target_os = "aix", target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", target_os = "solaris", )))] backend::termios::types::B3500000 => Some(3_500_000), #[cfg(not(any( target_arch = "sparc", target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", + bsd, + target_os = "aix", target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", target_os = "solaris", )))] backend::termios::types::B4000000 => Some(4_000_000), diff --git a/vendor/rustix/src/termios/mod.rs b/vendor/rustix/src/termios/mod.rs index 5c4cccca9..ffbb1b663 100644 --- a/vendor/rustix/src/termios/mod.rs +++ b/vendor/rustix/src/termios/mod.rs @@ -10,783 +10,10 @@ mod tc; mod tty; #[cfg(not(target_os = "wasi"))] -pub use cf::{cfgetispeed, cfgetospeed, cfmakeraw, cfsetispeed, cfsetospeed, cfsetspeed}; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B1000000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B1152000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B1500000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B2000000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B2500000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B3000000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B3500000; -#[cfg(not(any( - target_arch = "sparc", - target_arch = "sparc64", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B4000000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "openbsd", - target_os = "wasi", -)))] -pub use constants::B460800; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B500000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::B576000; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "openbsd", - target_os = "wasi", -)))] -pub use constants::B921600; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::BRKINT; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::BS0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::BS1; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::BSDLY; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "wasi", -)))] -pub use constants::CBAUD; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CBAUDEX; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "wasi", -)))] -pub use constants::CIBAUD; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CLOCAL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CMSPAR; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CR0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CR1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CR2; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CR3; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::CRDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CREAD; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::CRTSCTS; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CS5; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CS6; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CS7; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CS8; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CSIZE; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::CSTOPB; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ECHO; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::ECHOCTL; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ECHOE; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ECHOK; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::ECHOKE; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ECHONL; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::ECHOPRT; -#[cfg(not(any( - target_os = "emscripten", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::EXTA; -#[cfg(not(any( - target_os = "emscripten", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::EXTB; -#[cfg(not(any( - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi", -)))] -pub use constants::EXTPROC; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::FF0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::FF1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::FFDLY; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::FLUSHO; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::HUPCL; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ICRNL; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::IEXTEN; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::IGNBRK; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::IGNCR; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::IGNPAR; -#[cfg(not(any( - target_os = "haiku", - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi", -)))] -pub use constants::IMAXBEL; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::INLCR; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::INPCK; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ISIG; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ISTRIP; -#[cfg(any( - linux_raw, - all( - libc, - any(target_os = "haiku", target_os = "illumos", target_os = "solaris"), - ) -))] -pub use constants::IUCLC; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::IUTF8; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::IXANY; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::IXOFF; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::IXON; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::NL0; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::NL1; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::NLDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::NOFLSH; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::OCRNL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "wasi", -)))] -pub use constants::OFDEL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "wasi", -)))] -pub use constants::OFILL; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "redox", - target_os = "wasi", -)))] -pub use constants::OLCUC; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ONLCR; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ONLRET; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::ONOCR; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::OPOST; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::PARENB; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::PARMRK; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::PARODD; -#[cfg(not(any( - target_os = "ios", - target_os = "macos", - target_os = "redox", - target_os = "wasi" -)))] -pub use constants::PENDIN; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::TAB0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::TAB1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::TAB2; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::TAB3; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "illumos", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::TABDLY; -#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))] -pub use constants::TOSTOP; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::VSWTC; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::VT0; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::VT1; -#[cfg(not(any( - all(libc, target_env = "musl"), - target_os = "dragonfly", - target_os = "freebsd", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::VTDLY; -#[cfg(any(linux_raw, all(libc, any(target_arch = "s390x", target_os = "haiku"))))] -pub use constants::XCASE; -#[cfg(not(any( - target_os = "dragonfly", - target_os = "freebsd", - target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "redox", - target_os = "solaris", - target_os = "wasi", -)))] -pub use constants::XTABS; +pub use cf::*; #[cfg(not(target_os = "wasi"))] -pub use constants::{ - speed_value, B0, B110, B115200, B1200, B134, B150, B1800, B19200, B200, B230400, B2400, B300, - B38400, B4800, B50, B57600, B600, B75, B9600, ICANON, VEOF, VEOL, VEOL2, VERASE, VINTR, VKILL, - VMIN, VQUIT, VSTART, VSTOP, VSUSP, VTIME, -}; -#[cfg(not(any(target_os = "haiku", target_os = "wasi")))] -pub use constants::{VDISCARD, VLNEXT, VREPRINT, VWERASE}; +pub use constants::*; #[cfg(not(target_os = "wasi"))] -pub use tc::{ - tcdrain, tcflow, tcflush, tcgetattr, tcgetpgrp, tcgetsid, tcgetwinsize, tcsendbreak, tcsetattr, - tcsetpgrp, tcsetwinsize, Action, OptionalActions, QueueSelector, Speed, Tcflag, Termios, - Winsize, -}; +pub use tc::*; #[cfg(not(windows))] -pub use tty::isatty; -#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))] -#[cfg(feature = "procfs")] -pub use tty::ttyname; +pub use tty::*; diff --git a/vendor/rustix/src/termios/tc.rs b/vendor/rustix/src/termios/tc.rs index e1a87b623..12f7f543c 100644 --- a/vendor/rustix/src/termios/tc.rs +++ b/vendor/rustix/src/termios/tc.rs @@ -2,6 +2,20 @@ use crate::fd::AsFd; use crate::process::Pid; use crate::{backend, io}; +#[cfg(all( + any(target_os = "android", target_os = "linux"), + any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "x32", + target_arch = "riscv64", + target_arch = "aarch64", + target_arch = "arm", + target_arch = "mips", + target_arch = "mips64", + ) +))] +pub use backend::termios::types::Termios2; pub use backend::termios::types::{ Action, OptionalActions, QueueSelector, Speed, Tcflag, Termios, Winsize, }; @@ -25,6 +39,37 @@ pub fn tcgetattr<Fd: AsFd>(fd: Fd) -> io::Result<Termios> { backend::termios::syscalls::tcgetattr(fd.as_fd()) } +/// `tcgetattr2(fd)`—Get terminal attributes. +/// +/// Also known as the `TCGETS2` operation with `ioctl`. +/// +/// # References +/// - [POSIX `tcgetattr`] +/// - [Linux `ioctl_tty`] +/// - [Linux `termios`] +/// +/// [POSIX `tcgetattr`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html +/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html +/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html +#[inline] +#[doc(alias = "TCGETS2")] +#[cfg(all( + any(target_os = "android", target_os = "linux"), + any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "x32", + target_arch = "riscv64", + target_arch = "aarch64", + target_arch = "arm", + target_arch = "mips", + target_arch = "mips64", + ) +))] +pub fn tcgetattr2<Fd: AsFd>(fd: Fd) -> io::Result<Termios2> { + backend::termios::syscalls::tcgetattr2(fd.as_fd()) +} + /// `tcgetwinsize(fd)`—Get the current terminal window size. /// /// Also known as the `TIOCGWINSZ` operation with `ioctl`. @@ -96,6 +141,41 @@ pub fn tcsetattr<Fd: AsFd>( backend::termios::syscalls::tcsetattr(fd.as_fd(), optional_actions, termios) } +/// `tcsetattr2(fd)`—Set terminal attributes. +/// +/// Also known as the `TCSETS2` operation with `ioctl`. +/// +/// # References +/// - [POSIX `tcsetattr`] +/// - [Linux `ioctl_tty`] +/// - [Linux `termios`] +/// +/// [POSIX `tcsetattr`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetattr.html +/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html +/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html +#[inline] +#[doc(alias = "TCSETS2")] +#[cfg(all( + any(target_os = "android", target_os = "linux"), + any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "x32", + target_arch = "riscv64", + target_arch = "aarch64", + target_arch = "arm", + target_arch = "mips", + target_arch = "mips64", + ) +))] +pub fn tcsetattr2<Fd: AsFd>( + fd: Fd, + optional_actions: OptionalActions, + termios: &Termios2, +) -> io::Result<()> { + backend::termios::syscalls::tcsetattr2(fd.as_fd(), optional_actions, termios) +} + /// `tcsendbreak(fd, 0)`—Transmit zero-valued bits. /// /// Also known as the `TCSBRK` operation with `ioctl`, with a duration of 0. |