6
Apr

Sharing a Variable Between Two Sources in Linux Kernel

Sharing a variable between two sources in the kernel tree is done pretty simply with the EXPORT_SYMBOL function. For example, to share the variable mac_address of source1.c with source2.c you would use the following.

source1.c

unsigned char mac_address[6];
EXPORT_SYMBOL(mac_address);

source2.c

extern unsigned char mac_address[6];

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 0 Comment So Far

Share your thoughts, leave a comment!