diff options
author | Michael Neumann <mneumann@ntecs.de> | 2015-09-09 20:16:42 +0200 |
---|---|---|
committer | Michael Neumann <mneumann@ntecs.de> | 2015-09-09 20:16:42 +0200 |
commit | f37e45628e44d86c16a6f02b38ea0a9d68e8b3d4 (patch) | |
tree | 3757e147ff4e9b4d30f493e63dec27e2eeebd6a7 /src/sys/termios.rs | |
parent | fad667e4e2c72889b55bcc7a21d87fa72218e101 (diff) | |
download | nix-f37e45628e44d86c16a6f02b38ea0a9d68e8b3d4.zip |
Add/Fix support for DragonFly BSD
Diffstat (limited to 'src/sys/termios.rs')
-rw-r--r-- | src/sys/termios.rs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sys/termios.rs b/src/sys/termios.rs index a9fd41ec..1ecac547 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -12,7 +12,7 @@ pub use self::ffi::consts::FlowArg::*; mod ffi { pub use self::consts::*; - #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd", target_os = "linux"))] mod non_android { use super::consts::*; use libc::c_int; @@ -36,7 +36,7 @@ mod ffi { } } - #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd", target_os = "linux"))] pub use self::non_android::*; // On Android before 5.0, Bionic directly inline these to ioctl() calls. @@ -95,13 +95,24 @@ mod ffi { pub use self::android::*; - #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))] + #[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd"))] pub mod consts { + #[cfg(not(target_os = "dragonfly"))] use libc::{c_int, c_ulong, c_uchar}; + #[cfg(target_os = "dragonfly")] + use libc::{c_int, c_uint, c_uchar}; + #[cfg(not(target_os = "dragonfly"))] pub type tcflag_t = c_ulong; + #[cfg(target_os = "dragonfly")] + pub type tcflag_t = c_uint; + pub type cc_t = c_uchar; + + #[cfg(not(target_os = "dragonfly"))] pub type speed_t = c_ulong; + #[cfg(target_os = "dragonfly")] + pub type speed_t = c_uint; #[repr(C)] #[derive(Clone, Copy)] @@ -150,6 +161,7 @@ mod ffi { const IXOFF = 0x00000400, const IXANY = 0x00000800, const IMAXBEL = 0x00002000, + #[cfg(not(target_os = "dragonfly"))] const IUTF8 = 0x00004000, } } |