Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-26-2005, 07:14 AM   #1
LQ Newbie
Registered: Mar 2005
Location: bangalore india
Posts: 3

Rep: Reputation: 0
linux device driver programming

hi friends,

In struct file_options{ (*read)();(*open)() ...} we store the address of our function to be executed.but during the call in driver program,we only use read(),open() etc. How the compiler knows that it is a member of struct though we don't dereferenced the struct member by dot operator?How it is defferenciated with the same system call functions read(),open() etc.

waiting for response...
Old 03-26-2005, 07:30 AM   #2
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
The compiler does not. things are little more complex than that.
I dont think I can give a full explanation a high level overview will be something like this.
the read() call you make invokes a library call.
this does some neat little tricks and call the generic system call stub and end up somewhere in sys_read. sys read will again do some tricks find the file ops structure for your device (this will be stored in the file table when you did the open). and it will call your read routine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
C++ or pure C for Linux kernel module, Linux device driver development. What to use? Igor007 Programming 91 07-19-2014 11:55 AM
Linux Device Driver malacma Linux - Software 10 10-09-2007 06:14 AM
Linux device driver programming iammisc Programming 1 11-26-2005 10:46 AM
I want some guide to know the basic about device drivers programming in linux. kadhiravan.r Linux - Software 2 07-18-2005 07:07 AM
Linux Driver Programming prowzen General 6 06-05-2001 02:44 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:14 AM.

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