[−][src]Macro nix::ioctl_write_int
Generates a wrapper function for a ioctl that writes an integer 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:
ⓘThis example is not tested
pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result<libc::c_int>
nix::sys::ioctl::ioctl_param_type
depends on the OS:
- BSD -
libc::c_int
- Linux -
libc::c_ulong
For a more in-depth explanation of ioctls, see ::sys::ioctl
.
Example
ioctl_write_int!(vt_activate, b'v', 4);