LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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-08-2011, 12:12 AM   #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-08-2011 at 12:15 AM.
 
Old 12-08-2011, 05:52 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
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


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




All times are GMT -5. The time now is 05:35 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration