[−][src]Function v4l::v4l2::api::ioctl
pub unsafe fn ioctl(
fd: c_int,
request: _IOC_TYPE,
argp: *mut c_void
) -> Result<()>
A convenience wrapper around v4l2_ioctl.
In case of errors, the last OS error will be reported, aka errno on Linux.
Arguments
fd
- File descriptorrequest
- IO control code (see codes)argp
- Pointer to memory region holding the argument type
Safety
For maximum flexibility, argp must be a raw pointer. Thus, the entire function is unsafe.
Example
extern crate v4l; use std::mem; use v4l::v4l_sys::*; use v4l::v4l2; let fd = v4l2::open("/dev/video0", libc::O_RDWR); let mut v4l2_caps: v4l2_capability; unsafe { v4l2_caps = mem::zeroed(); } if let Ok(fd) = fd { unsafe { v4l2::ioctl(fd, v4l2::vidioc::VIDIOC_QUERYCAP, &mut v4l2_caps as *mut _ as *mut std::os::raw::c_void); } }