[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Header Problem with RH 8.0



On Tue, 2003-06-03 at 07:42, Ashutosh Mehra wrote:
> Hi!
> 
> I was recently trying a few Loadable Kernel Modules with Linux, and the 
> traditional "Hello World!" module worked fine, except that I couldnt 
> find which header file contains the prototype of printk() (gcc with 
> -Wall gave a warning). Does any one know where is this function prototyped?

Have you tried grep?  It's your friend.  It would have quicky shown you
it is in include/linux/kernel.h

> Now for the bigger problem: When I opened /usr/include/linux/fs.h, I 
> didn't find the definition of the "struct file{}", which I needed for a 
> module, though it was there in /usr/src/linux-2.4/include/linux/fs.h. 
> The /usr/include header contained only a portion of the kernel header.
> So my question is this: How do I get the definition if "file struct". 
> Which are the correct headers to be used in the modules: the kernel 
> headers from the src/ directory, or from the /usr/include directory?

Looks like you already found it.  #include <linux/fs.h>
As others have said over and over.  Do not include any
headers from /usr/include in any Linux kernel code.  Don't
even think about doing it.


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/