diff --git a/changelog/2580.added.md b/changelog/2580.added.md new file mode 100644 index 0000000000..52ddd876ac --- /dev/null +++ b/changelog/2580.added.md @@ -0,0 +1 @@ +Added Fuchsia support for `ioctl`. diff --git a/src/sys/ioctl/linux.rs b/src/sys/ioctl/linux.rs index 52312f4f04..85837f2fe3 100644 --- a/src/sys/ioctl/linux.rs +++ b/src/sys/ioctl/linux.rs @@ -1,10 +1,14 @@ 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..249643b9a4 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 = "fuchsia", target_os = "redox"))] #[macro_use] mod linux; -#[cfg(any(linux_android, target_os = "redox"))] +#[cfg(any(linux_android, target_os = "fuchsia", target_os = "redox"))] 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..9b03529443 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -31,7 +31,13 @@ feature! { pub mod fanotify; } -#[cfg(any(bsd, linux_android, target_os = "redox", solarish))] +#[cfg(any( + bsd, + linux_android, + solarish, + target_os = "fuchsia", + target_os = "redox", +))] #[cfg(feature = "ioctl")] #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] #[macro_use]