summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/clock-gettime/clock-gettime.cpp
blob: edb71f524d84ad4133922220f2477f5b6e696edc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <unistd.h>
#include <time.h>

int main(int, char **)
{
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
    timespec ts;
    clock_gettime(CLOCK_REALTIME, &ts);
#else
#  error "Feature _POSIX_TIMERS not available"
    // MIPSpro doesn't understand #error, so force a compiler error
    force_compiler_error = true;
#endif
    return 0;
}