DragonFly kernel List (threaded) for 2008-04
DragonFly BSD
DragonFly kernel List (threaded) for 2008-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Testing monotonic clock


From: Hasso Tepper <hasso@xxxxxxxxx>
Date: Tue, 1 Apr 2008 14:26:09 +0300

I have a software piece which checks for existance of monotonic clock with 
following testpiece:

#define _POSIX_C_SOURCE 199309L
#include <time.h>

int main(int argc, char *argv[]) {
    struct timespec tp;

    if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
        return 0;
    else
        return 1;
}

It fails in DragonFly:

In file included from clock-test.c:2:
/usr/include/time.h:135: error: expected '=', ',', ';', 'asm' 
or '__attribute__' before 'strftime'
clock-test.c: In function 'main':
clock-test.c:5: error: storage size of 'tp' isn't known
clock-test.c:7: error: 'CLOCK_MONOTONIC' undeclared (first use in this 
function)
clock-test.c:7: error: (Each undeclared identifier is reported only once
clock-test.c:7: error: for each function it appears in.)


It's obvious that someone has to include sys/time.h somewhere, but who and 
where? What's buggy - DragonFly or this test?


-- 
Hasso Tepper



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]