Defining ioctl Commands
To define an ioctl command, you’d call one of the following macros: _IO, _IOR, _IOW, or _IOWR. An explanation of each macro is provided in Table 3-1.
Table 3-1. ioctl Command Macros
Macro | Description |
|---|---|
| Creates an ioctl command for an I/O operation that transfers no data—in other words, the |
| Creates an ioctl command for a read operation; read operations transfer data from the device to user space; for example, retrieving error information |
| Creates an ioctl command for a write operation; write operations transfer data to the device from user space; for example, setting a device parameter |
| Creates an ioctl command for an I/O operation with bidirectional ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access