On 30 March 2013 06:25, Brad Smith <b...@comstyle.com> wrote: > init_get_clock() already indicates to get_clock() to utilize > clock_gettime() with a monotonic clock but OpenBSD was missing > from the list of OS's to use a monotonic clock on. > > What I don't understand is why is init_get_clock() not called > anywhere?
It's marked as a constructor so the C runtime will call it. > diff --git a/include/qemu/timer.h b/include/qemu/timer.h > index 1766b2d..8b86fa5 100644 > --- a/include/qemu/timer.h > +++ b/include/qemu/timer.h > @@ -118,7 +118,8 @@ extern int use_rt_clock; > static inline int64_t get_clock(void) > { > #if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= > 500000) \ > - || defined(__DragonFly__) || defined(__FreeBSD_kernel__) > + || defined(__DragonFly__) || defined(__FreeBSD_kernel__) \ > + || defined(__OpenBSD__) > if (use_rt_clock) { > struct timespec ts; > clock_gettime(CLOCK_MONOTONIC, &ts); Rather than extending this already long OS dependent #if, could you write a configure test for whatever we're using and then just have a simple #ifdef CONFIG_WHATEVER ? thanks -- PMM