FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-19-2010, 03:29 PM
 
Default kernel mod compilation frustration

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.

??
mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-20-2010, 11:29 AM
James Pearson
 
Default kernel mod compilation frustration

m.roth@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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-20-2010, 02:46 PM
 
Default kernel mod compilation frustration

James Pearson wrote:
> m.roth@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
>
I did finally find that out, after I posted, and it makes sense, since
it's *got* to be statically linked.

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

I see, and thanks! I note there's no man page for any of them. Also, this
is, um, odd: going to 5.5, I started getting garbage in the logs for gspca
(for an old video camera; we have a number, for security, in our locked
server rooms); I added a sleep, as I mentioned, and it worked fine. Then
it stopped working... and with the latest kernel, suddenly, it works fine
again, *without* the sleep().

Dunno, dunno, some timing thing.

Again, thanks, and I *will* push that info onto the stack, to be popped
off when needed next.

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org