diff options
author | Bryant Mairs <bryant@mai.rs> | 2017-07-11 09:55:47 -0700 |
---|---|---|
committer | Marcin Mielniczuk <marmistrz.dev@zoho.eu> | 2017-07-25 09:09:52 +0200 |
commit | a5b01c007586f3cbda72cd5c17c36e02ff72122f (patch) | |
tree | 8daacfcc2564f7d2c449b24024df7d2cd1f5ac9d /src/sys | |
parent | 1b9a779333df43e33c3c77f286aed64682001ffe (diff) | |
download | nix-a5b01c007586f3cbda72cd5c17c36e02ff72122f.zip |
Add a "bad none" variant to the ioctl macro
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/ioctl/mod.rs | 6 |
1 files changed, 6 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> { |