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
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
Seemingly Similar Threads
- Delays in DRM nouveau_bios.c
- Cygwin Rsync 2.5.6 over SSH hangs on Win2k->Win2k
- multiboot.mod and module.mod missing in grub-efi-arm64
- [PATCH] gpu: drm: nouveau: nvkm: nv40: Replace mdelay() with msleep() in nv40_sensor_setup()
- [Bug 14328] New: usleep() is obsolete, use nanosleep()