On Friday 27 July 2001 20:17, Tomasz Motylewski wrote:
> > i will store a function pointer of a function d
> > here i faced probem that i am not able to access function pointer
> > in linux appl.
> > its giving compiler error...
> > that functionname(), ....
> >
> > whether doing this way is correct or not ???
>
> Not. Kernel is different adress space, and your user program is not
> linked with it.
>
> Use indexes (like 1,2,3,4,5,6...) instead of pointers.
>
> You can set up in the kernel array of function pointers:
>
> int (*(functions[NNN]))() = { func1, func2, func3, ... };
>
> functions[i](); <- call this way.
BTW, do throw some argument checking in where you read the FIFO! If you
don't, there just *has* to be some silly bug on the user space side,
generating out-of-bound function indexes... *heh*
It's generally a good idea to throw error checking in where you can,
especially in init/close code that isn't performance critical. It does
save time, especially when a simple mistake can crash your system.
//David Olofson --- Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------> http://www.linuxaudiodev.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> [EMAIL PROTECTED] -'
----- End of forwarded message from [EMAIL PROTECTED] -----
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/