From d05ef160453e98546a4197496dc8a3cb2defac53 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 4 Apr 2013 20:37:53 -0400 Subject: Allow clock_gettime() monotonic clock to be utilized on more OS's Allow the clock_gettime() code using monotonic clock to be utilized on more POSIX compliannt OS's. This started as a fix for OpenBSD which was listed in one function as part of the previous hard coded list of OS's for the functions to support but not in the other. Signed-off-by: Brad Smith Reviewed-by: Paolo Bonzini Message-id: 20130405003748.GH884@rox.home.comstyle.com Signed-off-by: Anthony Liguori --- include/qemu/timer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 1766b2d6c7..c363190fca 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -117,8 +117,7 @@ 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__) +#ifdef CLOCK_MONOTONIC if (use_rt_clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); -- cgit v1.2.3