Update the get_clock() function so it will utilize clock_gettime() with

monotonic time on OpenBSD instead of using gettimeofday().

ok sthen@
This commit is contained in:
brad 2013-04-01 13:40:32 +00:00
parent d391699720
commit 0ba56332b3
2 changed files with 15 additions and 1 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.101 2013/03/20 00:46:01 brad Exp $
# $OpenBSD: Makefile,v 1.102 2013/04/01 13:40:32 brad Exp $
ONLY_FOR_ARCHS= amd64 i386 powerpc sparc64
COMMENT= multi system emulator
DISTNAME= qemu-1.4.0
REVISION= 0
CATEGORIES= emulators
MASTER_SITES= http://wiki.qemu.org/download/
EXTRACT_SUFX= .tar.bz2

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-include_qemu_timer_h,v 1.1 2013/04/01 13:40:32 brad Exp $
--- include/qemu/timer.h.orig Sun Mar 31 14:23:42 2013
+++ include/qemu/timer.h Sun Mar 31 14:24:08 2013
@@ -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);