LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 10-18-2010, 02:20 AM   #1
nithima
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Rep: Reputation: 0
What is the meaning of using "__KERNEL__" and "MODULE" macro?


Hi everybody,

Now I am reading some kernel source codes,
And I found
#ifdef __KERNEL__
<and>
#define __KERNEL__
in some codes.

What 's it?
What happen, when it is selected to use(or not use)?

And "MODULE" macro for same above questions.
 
Old 10-18-2010, 08:26 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Quote:
Originally Posted by nithima View Post
What is the meaning of using "__KERNEL__" and "MODULE" macro
These define macros are used by some header files to determine which definitions to provide.

Some library headers will provide extra access to kernel level code, hence the __KERNEL__ definition.

And some kernel headers will differ depending on whether you are compiling kernel module code or directly linked kernel code, hence the MODULE definition.

Where these macros are not defined in a module's code, they are usually defined in the gcc line that compiles the code.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error "invalid module format" and "insert kernel module"? shayori Linux - Newbie 8 02-25-2010 03:48 AM
"Multicolumn" or "tiles", or even "list" icon view on desktop, in any DE? the dsc Linux - Desktop 3 02-20-2010 09:25 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM


All times are GMT -5. The time now is 02:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration