X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ftime%2Ftimer_getoverrun.c;h=e7f891e4040fe3ff3117a15dec1bbab70cc75ad1;hb=1b52863e244ecee5b5935b6d36bb9e6efe84c035;hp=8a86833d4a481a9f9dbb19ccba9e110dfad2aca9;hpb=cd3bb38412cfcc3bc47985ba25287e0af463609a;p=musl diff --git a/src/time/timer_getoverrun.c b/src/time/timer_getoverrun.c index 8a86833d..e7f891e4 100644 --- a/src/time/timer_getoverrun.c +++ b/src/time/timer_getoverrun.c @@ -1,8 +1,12 @@ #include +#include #include "pthread_impl.h" int timer_getoverrun(timer_t t) { - if ((uintptr_t)t >= 0x100000) t = ((pthread_t)t)->result; - return syscall(SYS_timer_getoverrun, (long)t); + if ((intptr_t)t < 0) { + pthread_t td = (void *)((uintptr_t)t << 1); + t = (void *)(uintptr_t)(td->timer_id & INT_MAX); + } + return syscall(SYS_timer_getoverrun, t); }