7 Aug
2016
7 Aug
'16
12:15 p.m.
Takashi Sakamoto wrote:
Data from user space is once copied to kernel stack, then operated and copied to user space, in a consistent manner. This manner forces all ioctl operations to copy the data from/to user space, even if it's read-only or write-only. Thus, it has an overhead for simpler ioctl commands.
The ioctl code itself already contains information about the direction and size of the data to be copied (and in theory, these values are correct). See dispatch_ioctl() in drivers/firewire/core-cdev.c for an example.
Regards, Clemens