Ioctl
This commit is contained in:
parent
04b82dab30
commit
0657191cf0
5 changed files with 143 additions and 0 deletions
18
ioctl_chardev/my-ioctl.h
Normal file
18
ioctl_chardev/my-ioctl.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef MY_IOCTL_H
|
||||
#define MY_IOCTL_H
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/*
|
||||
* Crucial point here, the kernel defines a set of macros for defining IOCTL numbers:
|
||||
* _IO - No command
|
||||
* _IOR - Read command
|
||||
* _IOW - Write command
|
||||
* _IORW - RW command
|
||||
* _IOC - Basis of the others
|
||||
* These macros encode the data type passed to the ioctl.
|
||||
*/
|
||||
|
||||
#define MY_IOCTL_WIPE _IO('k', 0x01)
|
||||
#define MY_IOCTL_FILL _IO('k', 0x02) /* Name is a placeholder, fills nothing */
|
||||
|
||||
#endif // MY-IOCTL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue