We've been using gettimeofday() on VxWorks, because configury didn't
state clock_gettime was available. It has been since at least
vxworks6.9, possibly earlier. Indeed, it's been available for longer
than gettimeofday(), so this enables libstdc++'s chrono.cc to work
with earlier 6.9 releases.
We've used clock_gettime unconditionally in __gthread_cond_timedwait
for a very long time, so it's not like this brings in a new
dependency, but it allows clocks and deadlines to work with the same
precision. Before this change, we'd use gettimeofday's coarser
clocks, and finer timed waits, which makes room for imprecisions.
for libstdc++-v3/ChangeLog
* acinclude.m4 (GLIBXX_ENABLE_LIBSTDCXX_TIME) [vxworks*]:
Enable monotonic and realtime clocks.
* configure: Rebuilt.
# VxWorks has nanosleep as soon as the kernel is configured with
# INCLUDE_POSIX_TIMERS, which is normally/most-often the case.
vxworks*)
+ ac_has_clock_monotonic=yes
+ ac_has_clock_realtime=yes
ac_has_nanosleep=yes
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
# VxWorks has nanosleep as soon as the kernel is configured with
# INCLUDE_POSIX_TIMERS, which is normally/most-often the case.
vxworks*)
+ ac_has_clock_monotonic=yes
+ ac_has_clock_realtime=yes
ac_has_nanosleep=yes
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)