I am tweaking code residing in the /net directory of linux kernel.
I was trying things like printing but I see that there are no relevant headers (like stdlib.h, stdio.h etc). So how can I do this at the kernel level?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot use any user space library functions in kernel, You should use only functions exported by the kernel. So, there will not be
stdio.h,stdlib.h, etc. If you want to print something in the kernel, you have theprintk()function, this is equivalent toprintf()in user space.See also my blog posts Linux Module Programming Part1 and Part2.