]> granicus.if.org Git - check/commit
Determine at runtime which clockid_t to use for clock_gettime
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Sep 2013 15:17:56 +0000 (15:17 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Sep 2013 15:17:56 +0000 (15:17 +0000)
commit028f078c32abfdce18912b7f79212fe0d185663f
treee0bde3be1991e26f3e1ae7b35953360abdcd14c2
parentc7daccb9b19c106c15adc909f6ebaa163341e037
Determine at runtime which clockid_t to use for clock_gettime

The cygwin platform (perhaps others) does not support
CLOCK_MONOTONIC in clock_gettime. However, it does support
CLOCK_REALTIME. Instead of having every call to clock_gettime
check which clock to use, check once and cache the result.

The only two clock options which seemed useful are CLOCK_MONOTONIC
and CLOCK_REALTIME. If others are available in the future
(or another clock type seems a good alternative if these two are
missing on a system) it can be added later.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@787 64e312b2-a51f-0410-8e61-82d0ca0eb02a
src/check.c
src/check_impl.h
src/check_log.c
src/check_run.c