[CentOS] kernel mod compilation frustration

Tue Jul 20 11:29:42 UTC 2010
James Pearson <james-p at moving-picture.com>

m.roth at 5-cent.us wrote:
> I want to add a sleep() to a module. It tells me it can't find <time.h>;
> if I tell it "/usr/include/time.h", it gives me a ton of errors (I *have*
> put the #include just above where I call sleep, not up at the top).
> Any clues as to what I'm doing wrong? With kernel
> /vmlinuz-2.6.18-194.3.1.el5, I just added the line
> extern unsigned int sleep( unsigned int seconds );
> and everything was wonderful; with the current kernel, it complains sleep
> is undefined.

The kernel doesn't use include files from /usr/include - it uses its own 
from its own include directory

You probably want to use something like ssleep(), msleep() or mdelay() - 
see include/linux/delay.h and kernel/timer.c

James Pearson