vmm_sys_util::ioctl

Function ioctl_with_ref

Source
pub unsafe fn ioctl_with_ref<F: AsRawFd, T>(
    fd: &F,
    req: c_ulong,
    arg: &T,
) -> c_int
Expand description

Run an ioctl with an immutable reference.

§Arguments

  • fd: an open file descriptor corresponding to the device on which to call the ioctl.
  • req: a device-dependent request code.
  • arg: an immutable reference passed to ioctl.

§Safety

The caller should ensure to pass a valid file descriptor and have the return value checked.