diff options
author | Brad Smith <brad@comstyle.com> | 2013-04-04 20:37:53 -0400 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-04 20:22:45 -0500 |
commit | d05ef160453e98546a4197496dc8a3cb2defac53 (patch) | |
tree | 00a0b93821e3e30206c76be73e66b022b4cb4eb7 /util | |
parent | c5a98cf333997616147a161ef4e4cf71bb9bd00a (diff) | |
download | qemu-d05ef160453e98546a4197496dc8a3cb2defac53.zip qemu-d05ef160453e98546a4197496dc8a3cb2defac53.tar.gz qemu-d05ef160453e98546a4197496dc8a3cb2defac53.tar.bz2 |
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 <brad@comstyle.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20130405003748.GH884@rox.home.comstyle.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/qemu-timer-common.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c index 16f5e75..95e0847 100644 --- a/util/qemu-timer-common.c +++ b/util/qemu-timer-common.c @@ -49,9 +49,7 @@ int use_rt_clock; static void __attribute__((constructor)) init_get_clock(void) { use_rt_clock = 0; -#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \ - || defined(__DragonFly__) || defined(__FreeBSD_kernel__) \ - || defined(__OpenBSD__) +#ifdef CLOCK_MONOTONIC { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { |