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

Re: conflicting symbol name



On Wed, May 09, 2001 at 12:45:09PM +0200, Doc wrote:
> i'm coding a module for kernel 2.4.3.
> i've managed the way of exporting no symbols with the macro
> EXPORT_NO_SYMBOLS.
> now, as far as my module is derived  from another module (khttpd), some
> functions have the same name of khttpd's ones but behave differently. my
> module is standalone and does not need khttpd.
> if i insert my module after khttpd and i look at /proc/modules i find
> this:
> 
> my_module	20877	1
> khttpd		24272	3	[my_module]
> 
> this avoids to remove khttpd before my_module and, maybe, it causes
> interference between the modules.
> how can i avoid this?
> should i change my function's names?

Yes, it's considered good coding style to use a unique prefix on every
symbol. For example, X Windows uses the 'X' prefix (XOpenDisplay), and
GTK+ uses 'gtk_' for all symbols (gtk_init). Most kernel modules do the
same (serial_ in drivers/char/serial.c).


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
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.kernelnewbies.org/