summaryrefslogtreecommitdiff
path: root/src/sys/termios.rs
diff options
context:
space:
mode:
authorJason King <jason.brian.king@gmail.com>2020-06-17 01:11:05 +0000
committerJason King <jason.brian.king@gmail.com>2021-03-21 23:04:03 +0000
commitd444f1bcf20b29d0ec69e30046c71d005a2b9d72 (patch)
tree09c410385c727ac6f9e9bfae71077901f5edfb6d /src/sys/termios.rs
parent7b3129a194ecbf3e5f99f30ff26ab0e6fa7f183d (diff)
downloadnix-d444f1bcf20b29d0ec69e30046c71d005a2b9d72.zip
illumos and Solaris support
Co-authored-by: Dominik Hassler <hadfl@omnios.org> Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
Diffstat (limited to 'src/sys/termios.rs')
-rw-r--r--src/sys/termios.rs52
1 files changed, 41 insertions, 11 deletions
diff --git a/src/sys/termios.rs b/src/sys/termios.rs
index c30de80d..f6981db9 100644
--- a/src/sys/termios.rs
+++ b/src/sys/termios.rs
@@ -299,11 +299,17 @@ libc_enum!{
target_os = "openbsd"))]
B76800,
B115200,
+ #[cfg(any(target_os = "illumos", target_os = "solaris"))]
+ B153600,
B230400,
+ #[cfg(any(target_os = "illumos", target_os = "solaris"))]
+ B307200,
#[cfg(any(target_os = "android",
target_os = "freebsd",
+ target_os = "illumos",
target_os = "linux",
- target_os = "netbsd"))]
+ target_os = "netbsd",
+ target_os = "solaris"))]
B460800,
#[cfg(any(target_os = "android", target_os = "linux"))]
B500000,
@@ -311,8 +317,10 @@ libc_enum!{
B576000,
#[cfg(any(target_os = "android",
target_os = "freebsd",
+ target_os = "illumos",
target_os = "linux",
- target_os = "netbsd"))]
+ target_os = "netbsd",
+ target_os = "solaris"))]
B921600,
#[cfg(any(target_os = "android", target_os = "linux"))]
B1000000,
@@ -354,6 +362,8 @@ impl TryFrom<libc::speed_t> for BaudRate {
target_os = "linux",
target_os = "netbsd"))]
use libc::{B460800, B921600};
+ #[cfg(any(target_os = "illumos", target_os = "solaris"))]
+ use libc::{B153600, B307200, B460800, B921600};
match s {
B0 => Ok(BaudRate::B0),
@@ -398,11 +408,19 @@ impl TryFrom<libc::speed_t> for BaudRate {
target_os = "openbsd"))]
B76800 => Ok(BaudRate::B76800),
B115200 => Ok(BaudRate::B115200),
+ #[cfg(any(target_os = "illumos",
+ target_os = "solaris"))]
+ B153600 => Ok(BaudRate::B153600),
B230400 => Ok(BaudRate::B230400),
+ #[cfg(any(target_os = "illumos",
+ target_os = "solaris"))]
+ B307200 => Ok(BaudRate::B307200),
#[cfg(any(target_os = "android",
target_os = "freebsd",
+ target_os = "illumos",
target_os = "linux",
- target_os = "netbsd"))]
+ target_os = "netbsd",
+ target_os = "solaris"))]
B460800 => Ok(BaudRate::B460800),
#[cfg(any(target_os = "android", target_os = "linux"))]
B500000 => Ok(BaudRate::B500000),
@@ -410,8 +428,10 @@ impl TryFrom<libc::speed_t> for BaudRate {
B576000 => Ok(BaudRate::B576000),
#[cfg(any(target_os = "android",
target_os = "freebsd",
+ target_os = "illumos",
target_os = "linux",
- target_os = "netbsd"))]
+ target_os = "netbsd",
+ target_os = "solaris"))]
B921600 => Ok(BaudRate::B921600),
#[cfg(any(target_os = "android", target_os = "linux"))]
B1000000 => Ok(BaudRate::B1000000),
@@ -502,37 +522,46 @@ libc_enum! {
VDISCARD,
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
+ target_os = "illumos",
target_os = "macos",
target_os = "netbsd",
- target_os = "openbsd"))]
+ target_os = "openbsd",
+ target_os = "solaris"))]
VDSUSP,
VEOF,
VEOL,
VEOL2,
VERASE,
- #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
+ #[cfg(any(target_os = "dragonfly",
+ target_os = "freebsd",
+ target_os = "illumos",
+ target_os = "solaris"))]
VERASE2,
VINTR,
VKILL,
VLNEXT,
- #[cfg(not(all(target_os = "linux", target_arch = "sparc64")))]
+ #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"),
+ target_os = "illumos", target_os = "solaris")))]
VMIN,
VQUIT,
VREPRINT,
VSTART,
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
+ target_os = "illumos",
target_os = "macos",
target_os = "netbsd",
- target_os = "openbsd"))]
+ target_os = "openbsd",
+ target_os = "solaris"))]
VSTATUS,
VSTOP,
VSUSP,
#[cfg(target_os = "linux")]
VSWTC,
- #[cfg(target_os = "haiku")]
+ #[cfg(any(target_os = "haiku", target_os = "illumos", target_os = "solaris"))]
VSWTCH,
- #[cfg(not(all(target_os = "linux", target_arch = "sparc64")))]
+ #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"),
+ target_os = "illumos", target_os = "solaris")))]
VTIME,
VWERASE,
#[cfg(target_os = "dragonfly")]
@@ -540,7 +569,8 @@ libc_enum! {
}
}
-#[cfg(all(target_os = "linux", target_arch = "sparc64"))]
+#[cfg(any(all(target_os = "linux", target_arch = "sparc64"),
+ target_os = "illumos", target_os = "solaris"))]
impl SpecialCharacterIndices {
pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF;
pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL;