timer_create fails (return=-1 errno=0)

Grant Edwards grant.b.edwards at gmail.com
Tue Oct 18 20:42:52 UTC 2011


On 2011-10-18, Khem Raj <raj.khem at gmail.com> wrote:
> On Tue, Oct 18, 2011 at 11:23 AM, Grant Edwards
><grant.b.edwards at gmail.com> wrote:
>> I'm trying to run some code that works fine using glibc on an AI32
>> desktop, but timer_create() is failing with a return value of -1 and
>> errno of 0 "Success". This is with uClibc 0.9.30.3 (as built by
>> crosstool-NG 1.12.0 for an ARM9 target.
>>
>> It looks like it's because uClibc doesn't support SIGEV_THREAD. ??At
>> least that's what I've concluded from looking at the librt code.
>
> yes that could be the cause. Can you use 0.9.32 release and use NPTL
> there it should work.

For now, I'm rewriting the code to use SIGEV_SIGNAL.

I tried to upgrade to 0.9.32 a couple months ago, but the "current"
version of busybox suported by buildroot at that time wouldn't build
with 0.9.32.  I'll have to revisit that issue at some point.

I've been looking at the sources for uClibc 0.9.32 and it looks
like SIGEV_THREAD is still not supported:


  root/librt/timer_create.c

    24	/* Create a per-process timer */
    25	int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t * timerid)
    26	{
    27	        int retval;
[...]
    41	
    42	        /* Notification via a thread is not supported yet */
    43	        if (__builtin_expect(evp->sigev_notify == SIGEV_THREAD, 1))
    44	                return -1;

The other question is why isn't errno set to something other than
"Success" when timer_create() fails?    

-- 
Grant Edwards               grant.b.edwards        Yow! Life is a POPULARITY
                                  at               CONTEST!  I'm REFRESHINGLY
                              gmail.com            CANDID!!



More information about the uClibc mailing list