module IOCTL
Included Modules
Extended Modules
Defined in:
asm-generic/ioctl.crioctl.cr
Constant Summary
-
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 Method Summary
- #_IO(type : Char | Int, nr : Int) : UInt32
-
#_IOC(dir : IOC, type : Int | Char, nr : Int, size : Int) : UInt32
Used to create numbers.
-
#_IOC_DIR(dir : IOC)
Decodes ioctl
dir
number. -
#_IOC_NR(nr : Int)
Decodes ioctl
nr
number. -
#_IOC_SIZE(size : Int)
Decodes ioctl
size
number. -
#_IOC_TYPE(type : Char | Int)
Decodes ioctl
type
number. -
#_IOR(type : Char | Int, nr : Int, size : T.class) : UInt32 forall T
_IOR means userland is reading and kernel is writing.
-
#_IOW(type : Char | Int, nr : Int, size : T.class) : UInt32 forall T
_IOW means userland is writing and kernel is reading.
- #_IOWR(type : Char | Int, nr : Int, size : T.class) : UInt32 forall T
-
#ioctl(fd : LibC::Int, request : UInt32, *arguments) : Nil
Executes an
#ioctl
call, and raises in case of an error -
#ioctl?(fd : LibC::Int, request : UInt32, *arguments) : Errno | Nil
Executes an
#ioctl
call, and returns anErrno
in case of an error.
Instance Method Detail
Used to create numbers.
_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