[ELDK] using other clocks with timer_create

Seimon Williams sw at Remsdaq.com
Wed Sep 24 12:10:20 CEST 2008


Hi Wolfgang and Robert,

Thanks very much for taking the time to reply. I'm not too sure of the
etiquette, but I put you both on the To: in the hope that the restrictive
spam filters here will ease off on any further mails!


Wolfgang Denk wrote:
> run  your  application  under control  of  the "strace" tool - this will
> show if it is a syscall or not.

I didn't want to clutter up the list with huge strace listings - I did as you suggested and didn't see any mention of timer_create in the strace output. So from what you said earlier, I understand this places it in the libc?

Rober Iakobashvili wrote:
> We had some similar issue on arm with CLOCK_MONOTONIC, where kernel 2.4
> series + MV patches was not fully supporting it (the code was inside, but
> the syscall was not opened in the map of system calls of kernel).
>
> When we patched it and re-built out toolchain, glibc has seen the
> syscall, and made the right choice of supporting it (before we got EINVAL)

I am using kernel 2.6.15, and in my include/asm/unistd.h I can see a line:
#define __NR_timer_create       (__NR_SYSCALL_BASE+257)


So I was thinking that I could 'simply' rebuild the toolchain and everything would work out. It turns out it was actually much simpler than I had scared myself into thinking thanks to the excellent eldk and crosstool!

Unfortunately I noticed the same line in the eldk supplied kernel's unistd.h. So I wasn't very hopeful, and I dug around some more. I realised that the glibc is being built with the linuxthreads option where the linuxthreads/sysdeps/pthread/timer_create.c has
if (clock__id != CLOCK_REALTIME) __set_errno(EINVAL);

I guess that's why I'm getting EINVAL!


Some hours later ...

It looks like the only way I'll be able to get CLOCK_MONOTONIC is by compiling the glibc for *arm* with nptl instead of linuxthreads, but looking at the crosstool matrix it doesn't look like it builds. I may have to rethink the timers I'm using.


Some more hours later ...

It's all pretty new to me, but I've been doing a load of searching and tinkering. I have come across Pengutronix's OSELAS.Toolchain: http://www.pengutronix.de/oselas/toolchain/index_en.html
and Crosstool-NG:
http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
that I'm thinking of checking out, but then it looks like the version of kernel I'm using is borderline whether it supports NPTL on arm or not...

Thanks again for your help, I'll let you know how I get on.

Cheers,

Seimon

***********************************************************************************************************************************************

This e-mail and any files transmitted with it are confidential and may be protected by legal privilege. If you are not the intended recipient, please notify the sender and delete the e-mail from your system. This e-mail has been scanned for malicious content but the internet is inherently insecure and Remsdaq Limited cannot accept any liability for the integrity of this message or its attachments. No employee of Remsdaq Limited or any Third Party is authorised to conclude any binding agreement on behalf of Remsdaq Limited by e-mail. 

Company Address: Remsdaq Ltd., Parkway, Deeside Industrial Park, Deeside, Flintshire, Wales, CH5 2NL.
Registered in England. Company Registration Number: 3417251

***********************************************************************************************************************************************

 






More information about the eldk mailing list