Skip to content

Commit 73e832d

Browse files
authored
Add ioctl support for Fuchsia (#2580)
Fuchsia supports the linux-style ioctl api.
1 parent 33efb1a commit 73e832d

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

changelog/2580.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added Fuchsia support for `ioctl`.

src/sys/ioctl/linux.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
use cfg_if::cfg_if;
22

33
/// The datatype used for the ioctl number
4-
#[cfg(any(target_os = "android", target_env = "musl"))]
4+
#[cfg(any(target_os = "android", target_os = "fuchsia", target_env = "musl"))]
55
#[doc(hidden)]
66
pub type ioctl_num_type = ::libc::c_int;
7-
#[cfg(not(any(target_os = "android", target_env = "musl")))]
7+
#[cfg(not(any(
8+
target_os = "android",
9+
target_os = "fuchsia",
10+
target_env = "musl"
11+
)))]
812
#[doc(hidden)]
913
pub type ioctl_num_type = ::libc::c_ulong;
1014
/// The datatype used for the 3rd argument

src/sys/ioctl/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@
227227
//! ```
228228
use cfg_if::cfg_if;
229229

230-
#[cfg(any(linux_android, target_os = "redox"))]
230+
#[cfg(any(linux_android, target_os = "fuchsia", target_os = "redox"))]
231231
#[macro_use]
232232
mod linux;
233233

234-
#[cfg(any(linux_android, target_os = "redox"))]
234+
#[cfg(any(linux_android, target_os = "fuchsia", target_os = "redox"))]
235235
pub use self::linux::*;
236236

237237
#[cfg(any(bsd, solarish, target_os = "haiku",))]

src/sys/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ feature! {
3131
pub mod fanotify;
3232
}
3333

34-
#[cfg(any(bsd, linux_android, target_os = "redox", solarish))]
34+
#[cfg(any(
35+
bsd,
36+
linux_android,
37+
solarish,
38+
target_os = "fuchsia",
39+
target_os = "redox",
40+
))]
3541
#[cfg(feature = "ioctl")]
3642
#[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))]
3743
#[macro_use]

0 commit comments

Comments
 (0)