* use of EXPORT_SYMBOL()
@ 2013-01-28 20:13 horseriver
2013-01-29 7:52 ` Mulyadi Santosa
2013-01-29 11:01 ` Reza Hoorfar
0 siblings, 2 replies; 6+ messages in thread
From: horseriver @ 2013-01-28 20:13 UTC (permalink / raw)
To: kernelnewbies
hi:)
In kernel code ,what is the use of EXPORT_SYMBOL()?
Does it export a function to user application ,
so this function can be used in user application ?
thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* use of EXPORT_SYMBOL()
2013-01-28 20:13 use of EXPORT_SYMBOL() horseriver
@ 2013-01-29 7:52 ` Mulyadi Santosa
2013-01-29 7:58 ` Adel Qodmani
2013-01-29 11:01 ` Reza Hoorfar
1 sibling, 1 reply; 6+ messages in thread
From: Mulyadi Santosa @ 2013-01-29 7:52 UTC (permalink / raw)
To: kernelnewbies
On Tue, Jan 29, 2013 at 3:13 AM, horseriver <horserivers@gmail.com> wrote:
> hi:)
>
> In kernel code ,what is the use of EXPORT_SYMBOL()?
> Does it export a function to user application ,
> so this function can be used in user application ?
So it can be used by kernel modules.
Think of it like "public" keyword in C++.
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* use of EXPORT_SYMBOL()
2013-01-29 7:52 ` Mulyadi Santosa
@ 2013-01-29 7:58 ` Adel Qodmani
2013-01-29 8:31 ` Mulyadi Santosa
0 siblings, 1 reply; 6+ messages in thread
From: Adel Qodmani @ 2013-01-29 7:58 UTC (permalink / raw)
To: kernelnewbies
On Tue, Jan 29, 2013 at 9:52 AM, Mulyadi Santosa
<mulyadi.santosa@gmail.com>wrote:
> On Tue, Jan 29, 2013 at 3:13 AM, horseriver <horserivers@gmail.com> wrote:
> > hi:)
> >
> > In kernel code ,what is the use of EXPORT_SYMBOL()?
> > Does it export a function to user application ,
> > so this function can be used in user application ?
>
> So it can be used by kernel modules.
>
> Think of it like "public" keyword in C++.
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
And you're allowed to use it in Kernel modules too? I mean I can expose a
function in a kernel module that I am building by using EXPORT_SYMBOL?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130129/b79893a9/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* use of EXPORT_SYMBOL()
2013-01-29 7:58 ` Adel Qodmani
@ 2013-01-29 8:31 ` Mulyadi Santosa
2013-01-29 10:13 ` Anuz Pratap Singh Tomar
0 siblings, 1 reply; 6+ messages in thread
From: Mulyadi Santosa @ 2013-01-29 8:31 UTC (permalink / raw)
To: kernelnewbies
On Tue, Jan 29, 2013 at 2:58 PM, Adel Qodmani <mpcadel@gmail.com> wrote:
> And you're allowed to use it in Kernel modules too? I mean I can expose a
> function in a kernel module that I am building by using EXPORT_SYMBOL?
technically, yes, you're allowed to export symbol(s) in your kernel
module. Of course, during compiling, module that uses that exported
symbol will be said as using unknown symbol (but since likely you will
use "extern", it will still go on).
During module linking in kernel space, that "unknown symbol name" will
be resolved. Just like what we see when a program link to function(s)
or variable(s) in dynamic libraries.
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* use of EXPORT_SYMBOL()
2013-01-29 8:31 ` Mulyadi Santosa
@ 2013-01-29 10:13 ` Anuz Pratap Singh Tomar
0 siblings, 0 replies; 6+ messages in thread
From: Anuz Pratap Singh Tomar @ 2013-01-29 10:13 UTC (permalink / raw)
To: kernelnewbies
On Tue, Jan 29, 2013 at 8:31 AM, Mulyadi Santosa
<mulyadi.santosa@gmail.com>wrote:
> On Tue, Jan 29, 2013 at 2:58 PM, Adel Qodmani <mpcadel@gmail.com> wrote:
> > And you're allowed to use it in Kernel modules too? I mean I can expose a
> > function in a kernel module that I am building by using EXPORT_SYMBOL?
>
> technically, yes, you're allowed to export symbol(s) in your kernel
> module. Of course, during compiling, module that uses that exported
> symbol will be said as using unknown symbol (but since likely you will
> use "extern", it will still go on).
>
> During module linking in kernel space, that "unknown symbol name" will
> be resolved. Just like what we see when a program link to function(s)
> or variable(s) in dynamic libraries.
>
>
> I think this is explained very well in LDD chapter 1 or 2) and LKD. Kernel
modules are in kernel space, so if you export a symbol it is available to
the kernel.
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Thank you
Warm Regards
Anuz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130129/fb687415/attachment-0001.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* use of EXPORT_SYMBOL()
2013-01-28 20:13 use of EXPORT_SYMBOL() horseriver
2013-01-29 7:52 ` Mulyadi Santosa
@ 2013-01-29 11:01 ` Reza Hoorfar
1 sibling, 0 replies; 6+ messages in thread
From: Reza Hoorfar @ 2013-01-29 11:01 UTC (permalink / raw)
To: kernelnewbies
You can use method signed by EXPORT_SYMBOL(xxx) on other modules (something
like public method on module that other module can import and use it)
-----Original Message-----
From: kernelnewbies-bounces@kernelnewbies.org
[mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of horseriver
Sent: Monday, January 28, 2013 11:43 PM
To: kernelnewbies at kernelnewbies.org
Subject: use of EXPORT_SYMBOL()
hi:)
In kernel code ,what is the use of EXPORT_SYMBOL()?
Does it export a function to user application ,
so this function can be used in user application ?
thanks!
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-01-29 11:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28 20:13 use of EXPORT_SYMBOL() horseriver
2013-01-29 7:52 ` Mulyadi Santosa
2013-01-29 7:58 ` Adel Qodmani
2013-01-29 8:31 ` Mulyadi Santosa
2013-01-29 10:13 ` Anuz Pratap Singh Tomar
2013-01-29 11:01 ` Reza Hoorfar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).