From 58d771c3e7c7f35ab39e315cec1962b5a51a50d0 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Fri, 10 Jan 2025 22:55:24 +0000 Subject: [PATCH] Add ioctl support for Fuchsia Fuchsia supports the linux-style ioctl api. --- src/sys/ioctl/linux.rs | 4 ++-- src/sys/ioctl/mod.rs | 4 ++-- src/sys/mod.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sys/ioctl/linux.rs b/src/sys/ioctl/linux.rs index 52312f4f04..5e7a79a279 100644 --- a/src/sys/ioctl/linux.rs +++ b/src/sys/ioctl/linux.rs @@ -1,10 +1,10 @@ use cfg_if::cfg_if; /// The datatype used for the ioctl number -#[cfg(any(target_os = "android", target_env = "musl"))] +#[cfg(any(target_os = "android", target_os = "fuchsia", target_env = "musl"))] #[doc(hidden)] pub type ioctl_num_type = ::libc::c_int; -#[cfg(not(any(target_os = "android", target_env = "musl")))] +#[cfg(not(any(target_os = "android", target_os = "fuchsia", target_env = "musl")))] #[doc(hidden)] pub type ioctl_num_type = ::libc::c_ulong; /// The datatype used for the 3rd argument diff --git a/src/sys/ioctl/mod.rs b/src/sys/ioctl/mod.rs index e1e808f19e..ab45130ce2 100644 --- a/src/sys/ioctl/mod.rs +++ b/src/sys/ioctl/mod.rs @@ -227,11 +227,11 @@ //! ``` use cfg_if::cfg_if; -#[cfg(any(linux_android, target_os = "redox"))] +#[cfg(any(linux_android, target_os = "redox", target_os = "fuchsia"))] #[macro_use] mod linux; -#[cfg(any(linux_android, target_os = "redox"))] +#[cfg(any(linux_android, target_os = "redox", target_os = "fuchsia"))] pub use self::linux::*; #[cfg(any(bsd, solarish, target_os = "haiku",))] diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 8bcd9afd15..9e55496c79 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -31,7 +31,7 @@ feature! { pub mod fanotify; } -#[cfg(any(bsd, linux_android, target_os = "redox", solarish))] +#[cfg(any(bsd, linux_android, target_os = "redox", target_os = "fuchsia", solarish))] #[cfg(feature = "ioctl")] #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] #[macro_use]