On Sat, Mar 08, 2025 at 03:07:25PM +0100, Peter Skvarka wrote:
> Hello,
> 
> I call ioctl() containing request code created with _IOR(..., mystruct)
> and kernel module processed it.
> When I create instance of mystruct, fill it's members with some values and I
> pass it's pointer like third parameter to ioctl() then members of structure
> appears zeroed in kernel code.
> 
> Is it correct behavior or am I doing something wrong ?

Yes, _IOR only reads data from the kernel (copies the result structure
out to userland), nothing is copied in from userland to kernel. _IOW
only copies in (userland -> kernel), _IORW does both.

Martin

Reply via email to