IO Device Control System Call¶
Header File¶
Source: include/sys/ioctl.h
#include <sys/ioctl.h>
Functions¶
-
int ioctl(int fd, unsigned long cmd, ...)¶
Perform generic I/O operation command on special files
- Parameters
fd – [in] File descriptor
cmd – [in] Command to execute, Argument parameter varies based on command.
- Returns
on success zero is returned, On error, -1 is returned, and errno is set appropriately.
Structures¶
Macros¶
-
TIOCOUTQ¶
Get output queue size (not sent + not acked) This command expects unsigned long
-
SIOCOUTQ¶
-
FIONREAD¶
Get number of bytes available to read This command expects unsigned long
-
SIOCINQ¶
-
FIONBIO¶
Set Blocking or non-blocking IO This command expects integer with 1 or 0
-
FIOASYNC¶
Set ASYNC IO operation
TODO: Unimplemented
