LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to define file_operations for kernel ioctl call (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-define-file_operations-for-kernel-ioctl-call-800829/)

David Li 04-08-2010 12:40 PM

How to define file_operations for kernel ioctl call
 
I have a kernel function device_ioctl(). How do I define it in file_operations?

1. struct file_operations memory_fops = {
ioctl:device_ioctl
};
2. struct file_operations memory_fops = {
.ioctl=device_ioctl
};
3. struct file_operations memory_fops = {
device_ioctl
};
which one is the right one?

Thanks

bsat 04-09-2010 12:12 AM

the second one should work fine, but this is the wrong forum i guess for kernel programming related queries. And, please do a little Google search before you post a question.

http://tldp.org/LDP/lkmpg/2.6/html/x892.html


All times are GMT -5. The time now is 08:39 AM.