LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-08-2010, 12:40 PM   #1
David Li
Member
 
Registered: Mar 2010
Posts: 42

Rep: Reputation: 15
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
 
Old 04-09-2010, 12:12 AM   #2
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ioctl call for obtaining the RSSI saioha Linux - Wireless Networking 11 03-27-2012 11:47 AM
ioctl call returns error. HarryBoy Programming 6 09-10-2008 10:08 AM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 06:45 PM
dm driver ioctl call tantrix Programming 0 05-16-2005 06:50 PM
Ioctl() call fails Custer Linux - Wireless Networking 0 02-16-2004 12:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration