_IOWR ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

i want to use an read and write ioctl. My problem is that i dont know
what i have to do to write something back from kernel to the userland
app that has called ioctl()?

To exchange data i've a struct with one parameter used as input for the
kernel and another as output to the userspace.

struct st_cmd_getBridgeInfo {
  __u32 bridge;	// param for kernel
  char	info[4092]; // result to userspace
};

#define TIS_IOC_GETBRIDGEINFO	_IOWR(0x88, 1, struct
st_cmd_getBridgeInfo)

I guessed that i have to do it this way, but if i write something to the
info array in kernel ive got nothing at userspace. The input to kernel
works very well. Do i have to use copy_to_user or something?

Any suggestions?

Bye Dan


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux