mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-24 18:51:36 +01:00
ioctl begins to work
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
/*
|
||||
Give integer and a pointer to the kernel, and get one positive integer out.
|
||||
|
||||
Feels like an archaic API... so many weird restrictions for something that could be so simple!
|
||||
|
||||
TODO: must the ioctl numbers be globally unique? How to ensure that?
|
||||
|
||||
Ioctl is super picky about the ioctl numbers, it is very annoying: https://stackoverflow.com/questions/10071296/ioctl-is-not-called-if-cmd-2
|
||||
|
||||
See how do_vfs_ioctl highjacks several values. This "forces" use to use the _IOx macros...
|
||||
|
||||
Documentation/ioctl/ioctl-number.txt has some info:
|
||||
|
||||
_IO an ioctl with no parameters
|
||||
_IOW an ioctl with write parameters (copy_from_user)
|
||||
_IOR an ioctl with read parameters (copy_to_user)
|
||||
_IOWR an ioctl with both write and read parameters.
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
Reference in New Issue
Block a user