<div dir="ltr">This is ONLY a hint for finding the header files in the /usr/src/linux directory. I do generally like this.<div><br></div><div>find include -type f | xargs grep "kthread_run"</div><div><br></div><div>
Replace "kthread_run" with new strings for searching. This is ONLY a HINT but you asked for clear explanation.</div><div><br></div><div>Regards,</div><div>Srinivas.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jul 19, 2013 at 3:38 PM, Ritesh Ranjan <span dir="ltr"><<a href="mailto:r.ranjan789@gmail.com" target="_blank">r.ranjan789@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I keep getting "implicit declaration of <some function>" error quite<br>
often. So I'm assuming I am not adding the correct header files when I<br>
am writing the module.<br>
<br>
eg. I wanted to create a kernel thread using<br>
ktheard_create/kthread_run, but couldn't find which header to include.<br>
While I was looking for solutions I stumbled upon ctags. It mostly<br>
gets the job done, but not always. I couldn't find the proper header<br>
to use for open(inode,file); even though ctags pointed me to<br>
<linux/fs.h>, I still get the implicit declaration error.<br>
<br>
Is there any way of finding exactly which headers to include when one<br>
is trying to use a function? A detailed explanation would be really<br>
great.<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br></div>