IOCTL
Inherits IOCTLS
Constants
DIRBITS = 2
IOC_DIRMASK = (1 << IOC_DIRBITS) - 1
IOC_DIRSHIFT = IOC_SIZESHIFT + IOC_SIZEBITS
IOC_IN = IOC_WRITE << IOC_DIRSHIF
for the drivers/sound files...
IOC_INOUT = (IOC_WRITE | IOC_READ) << IOC_DIRSHIFT
IOC_NRBITS = 8
The following is for compatibility across the various Linux platforms. The generic ioctl numbering scheme doesn't really enforce a type field. De facto, however, the top 8 bits of the lower 16 bits are indeed used as a type field, so we might just as well make this explicit here. Please be sure to use the decoding macros below from now on.
IOC_NRMASK = (1 << IOC_NRBITS) - 1
IOC_NRSHIFT = 0
IOC_OUT = IOC_READ << IOC_DIRSHIFT
IOC_SIZEBITS = 14
Let any architecture override either of the following before including this file.
IOC_SIZEMASK = (1 << IOC_SIZEBITS) - 1
IOC_SIZESHIFT = IOC_TYPESHIFT + IOC_TYPEBITS
IOC_TYPEBITS = 8
IOC_TYPEMASK = (1 << IOC_TYPEBITS) - 1
IOC_TYPESHIFT = IOC_NRSHIFT + IOC_NRBITS
IOCSIZE_MASK = IOC_SIZEMASK << IOC_SIZESHIFT
IOCSIZE_SHIFT = IOC_SIZESHIFT
VERSION = "0.1.0"
Instance methods
_IOR means userland is reading and kernel is writing.
_IOW means userland is writing and kernel is reading.
Executes an ioctl call, and raises in case of an error