ioctl(), passed structure zeroed

Peter Skvarka <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
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 ?

These things are working like I expect:
Regarding to _IOR(..., mystruct) I am able to fill some member values in 
kernel code and then these are visible when ioctl() returns in user-mode.
When I use _IOWR(..., mystruct) or _IOW(..., mystruct) and call ioctl()
then members of structure are not zeroed in kernel code.

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.