int ioctl(int fd, unsigned long request, void *argument);
This syscall manipulates the underlying device parameters of special files. It allows a device-dependent API for fetching and setting several modes.
Despite not all ioctl calls needing a specific value for their arguments, due to current limitations, all arguments must point to valid memory, regardless of whether it ends up used or not.
ioctl
returns 0
on success and -1
on failure, and sets the
following errno:
ENOTTY
: The passed file does not support the passed ioctl.
EBADF
: The passed file does not exist for the process.
EFAULT
: The passed argument is in non-accesible memory