Skip to content

Commit

Permalink
Consolidate bsd and illumos ioctl
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbking committed Mar 5, 2021
1 parent b7d19fe commit 270c317
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 99 deletions.
7 changes: 7 additions & 0 deletions src/sys/ioctl/bsd.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/// The datatype used for the ioctl number
#[doc(hidden)]
#[cfg(not(target_os = "illumos"))]
pub type ioctl_num_type = ::libc::c_ulong;

#[doc(hidden)]
#[cfg(target_os = "illumos")]
pub type ioctl_num_type = ::libc::c_int;

/// The datatype used for the 3rd argument
#[doc(hidden)]
pub type ioctl_param_type = ::libc::c_int;
Expand All @@ -12,6 +18,7 @@ mod consts {
#[doc(hidden)]
pub const OUT: ioctl_num_type = 0x4000_0000;
#[doc(hidden)]
#[allow(overflowing_literals)]
pub const IN: ioctl_num_type = 0x8000_0000;
#[doc(hidden)]
pub const INOUT: ioctl_num_type = IN|OUT;
Expand Down
92 changes: 0 additions & 92 deletions src/sys/ioctl/illumos.rs

This file was deleted.

9 changes: 2 additions & 7 deletions src/sys/ioctl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ pub use self::linux::*;

#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
target_os = "illumos",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
Expand All @@ -241,19 +242,13 @@ mod bsd;

#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
target_os = "illumos",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"))]
pub use self::bsd::*;

#[cfg(target_os = "illumos")]
#[macro_use]
mod illumos;

#[cfg(target_os = "illumos")]
pub use self::illumos::*;

/// Convert raw ioctl return value to a Nix result
#[macro_export]
#[doc(hidden)]
Expand Down

0 comments on commit 270c317

Please sign in to comment.