use super::abi::*;
use crate::{
result_from_value,
AsRawFd,
};
/// Makes an ioctl system call on a file descriptor.
///
/// # Safety
///
/// This library does know know about the different ioctls. It is up to the caller to ensure that
/// the ioctl it is making is safe.
#[inline]
pub unsafe fn ioctl(fd: &impl AsRawFd, cmd: u32, arg: usize) -> crate::Result<i32> {
let ret = unsafe { syscall_3(16, fd.as_raw_fd() as usize, cmd as usize, arg) as i32 };
result_from_value(ret)
}