LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   linux device driver programming (http://www.linuxquestions.org/questions/programming-9/linux-device-driver-programming-306259/)

chandansingh 03-26-2005 07:14 AM

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...
chandan

zeropash 03-26-2005 07:30 AM

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.


All times are GMT -5. The time now is 07:00 PM.