Macro ioctl_none
macro_rules! ioctl_none {
($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => { ... };
}
Generates a wrapper function for an ioctl that passes no data to the kernel.
The arguments to this macro are:
- The function name
- The ioctl identifier
- The ioctl sequence number
The generated function has the following signature:
pub unsafe
For a more in-depth explanation of ioctls, see ::sys::ioctl.
Example
The videodev2 driver on Linux defines the log_status ioctl as:
This can be implemented in Rust like:
# #[macro_use] extern crate nix;
ioctl_none!(log_status, b'V', 70);
fn main() {}