[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about EXPORT_SYMBOL



On Sat, 17 Feb 2001, Sourav Sen wrote:

> 
> Hello,
> 	As far as I know, by EXPORT_SYMBOL you can only make those symbols
> visible to the rest of the kernel. For having your own entry points You
> have to have system calls. But there is a trick there, what you can do is
> you can implement some dummy system calls, then
> "replace" them by your functions in your module, so that you need not
> compile kernel each time you change something. The mechanism is given in
> "Linux module programmer's guide" in the section "system calls". I have a
> local mirror of that in:
> 
> http://www2.csa.iisc.ernet.in/~sourav/linux/linux/linux_moduleprog/lkmpg-1.1.0.html/node20.html
> 
> But I have never tried to do that. So If u do that way and suceed, plz.
> lemme know.
> 
> Bye
> sourav
> --------------------------------------------------------------------------------
> 
> On Sat, 17 Feb 2001, Tiziano Fagni wrote:
> 
> > Hi,
> > suppose I have writed a new device driver and I want to export a function 
> > that must be used from a process in user space. (such open(), close(), 
> > etc...). Can I use for this the macro EXPORT_SYMBOL?  If not, I must write a 
> > new system call? With the macro EXPORT_SYMBOL I can only export new function 
> > visible at kernel level? What is the best way to export a function for user 
> > space?
> > 
> > Thanks to all!!
> > Tiziano 

First, don't pay attention to that guide, I believe it makes no mention of the horrible
module unload race implicit in over-riding system calls with your own code.

Second, you almost definitely do NOT need to introduce a system call. Please describe what 
you're trying to do, and we can point you towards a better way.

EXPORT_SYMBOL(), by the way, is only used for symbols export by the kernel (and other modules) to
kernel modules.

john

-- 
"Allocation is a fatal error."
	- me, cpd_util.c. Never document at 4AM

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.surriel.com/kernelnewbies.shtml