summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sys/ioctl/mod.rs6
-rw-r--r--test/sys/test_ioctl.rs1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/sys/ioctl/mod.rs b/src/sys/ioctl/mod.rs
index b3388c28..ac8ff149 100644
--- a/src/sys/ioctl/mod.rs
+++ b/src/sys/ioctl/mod.rs
@@ -137,6 +137,12 @@ macro_rules! ioctl {
convert_ioctl_res!($crate::sys::ioctl::libc::ioctl(fd, $nr as $crate::sys::ioctl::libc::c_ulong, data))
}
);
+ (bad none $name:ident with $nr:expr) => (
+ pub unsafe fn $name(fd: $crate::sys::ioctl::libc::c_int)
+ -> $crate::Result<$crate::sys::ioctl::libc::c_int> {
+ convert_ioctl_res!($crate::sys::ioctl::libc::ioctl(fd, $nr as $crate::sys::ioctl::libc::c_ulong))
+ }
+ );
(none $name:ident with $ioty:expr, $nr:expr) => (
pub unsafe fn $name(fd: $crate::sys::ioctl::libc::c_int)
-> $crate::Result<$crate::sys::ioctl::libc::c_int> {
diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs
index 8a5b8a12..c0ae078a 100644
--- a/test/sys/test_ioctl.rs
+++ b/test/sys/test_ioctl.rs
@@ -2,6 +2,7 @@
// Simple tests to ensure macro generated fns compile
ioctl!(bad do_bad with 0x1234);
+ioctl!(bad none do_bad_none with 0x1234);
ioctl!(none do_none with 0, 0);
ioctl!(read read_test with 0, 0; u32);
ioctl!(write write_test with 0, 0; u64);