[uClibc] Hi-Res timers with uclibc

Eric Malkowski eric at bvwireless.net
Wed Aug 24 03:36:22 UTC 2005


Hi all-

I'm trying to use the Hi-res timers patch from the sourceforge.net project
with my uclibc buildroot x86 setup.

I have uclibc 0.9.27 and the latest hrtimers-2.4.20-3.0.patch and a
buildroot that is about 3 weeks old.

I'm using linux kernel 2.4.29 w/ a clone of the soekris target under
buildroot modified a bit for a different board.

I re-packaged the timers patch so it would apply to my kernel w/o hunk
failures.

I also re-made the linux-libc-headers-2.4.29.tar.bz2 file w/ the resultant
patched headers so these include files would include the timer_create(),
timer_settime(), etc. system calls introduced by the patch.

I then build the toolchain, uclibc, and ext2 rootfs and a small app that
tries to create a timer with timer_create().  The app is built w/ the
toolchain compiler, and linked against librt which looks like it should
call the system call just fine.

But ... When it runs on the target, it simply returns ENOSYS.  In the
kernel System.map file I can see sys_timer_create is there which isn't
present in kernels that aren't patched w/ the hi-res timers patch.  Also
earlier when I didn't have my custom linux-libc-headers-2.4.29.tar.bz2
file w/ hr timers patch pre-applied, my test program would fail to link
timer_create and timer_settime even w/ linking in librt -- i.e. librt
"seems" to have the right references to use the timer system calls present
in the kernel now, but it still doesn't work.

I also went down the path of building libposixtime.a that comes w/ the
hi-res timers support code against my kernel and with the toolchain
compiler.  I get the same result of timer_create function not implemented.

One last detail -- the number of system calls in the patch in file
include/linux/sys.h has NR_syscalls expect the value to be 256 and sets it
to 270 (through 267 are the additional timer calls), but my 2.4.29 kernel
already has 270 for NR_syscalls.  I assumed this was OK and just removed
that change from the patch.  I don't think even w/ the added timer calls
the entry points go over 270.

Any help / pointers would be greatly appreciated -- tips on where to debug
/ add some print statements to see where the ENOSYS is being returned?. 
It's not clear to me where uClibc makes the jump to kernel syscall and
somehow doesn't find a syscall where there should be one and actually
return the ENOSYS.

Thanks,

-Eric Malkowski




More information about the uClibc mailing list