LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 12-07-2011, 11:12 PM   #1
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Rep: Reputation: Disabled
wrapper_printk


Hi all,

Please post a example wrapper for printk. I have to use that wrapper instead of printk in my kernel code.
like instead of putting
if(sync_thread_log)
printk("sync_reqest was called\n"); everywhere in the code, i will just call the wrapper function.

Kindly help. I dont know how to write wrapper functions.


Thanks
-Nakul.

Last edited by GNakul; 12-07-2011 at 11:15 PM.
 
Old 12-08-2011, 04:52 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I'm not sure how you intend to make printk any shorter, unless you had other things you needed to do like :

Code:
errorhandler( char * msg){
  // do some stuff
  // do some more stuff
  printk(msg);
}


...
errorHandler("Foo failed");
...
 
  


Reply



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



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration