qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 07/13] osdep: add qemu_msleep


From: Paolo Bonzini
Subject: [Qemu-devel] [RFC PATCH 07/13] osdep: add qemu_msleep
Date: Mon, 15 Aug 2011 14:08:34 -0700

Signed-off-by: Paolo Bonzini <address@hidden>
---
 osdep.h       |    1 +
 oslib-posix.c |    7 ++++++-
 oslib-win32.c |    5 +++++
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/osdep.h b/osdep.h
index a817017..6bf4e1c 100644
--- a/osdep.h
+++ b/osdep.h
@@ -136,6 +136,7 @@ int qemu_madvise(void *addr, size_t len, int advice);
 
 int qemu_create_pidfile(const char *filename);
 int qemu_get_thread_id(void);
+void qemu_msleep(int);
 
 #ifdef _WIN32
 static inline void qemu_timersub(const struct timeval *val1,
diff --git a/oslib-posix.c b/oslib-posix.c
index 196099c..bcbe6a7 100644
--- a/oslib-posix.c
+++ b/oslib-posix.c
@@ -39,7 +39,7 @@ extern int daemon(int, int);
 #include "sysemu.h"
 #include "trace.h"
 #include "qemu_socket.h"
-
+#include <sys/poll.h>
 
 
 int qemu_daemon(int nochdir, int noclose)
@@ -174,3 +174,8 @@ int qemu_utimensat(int dirfd, const char *path, const 
struct timespec *times,
 
     return utimes(path, &tv[0]);
 }
+
+void qemu_msleep(int msec)
+{
+    poll(NULL, 0, msec);
+}
diff --git a/oslib-win32.c b/oslib-win32.c
index 5f0759f..d823931 100644
--- a/oslib-win32.c
+++ b/oslib-win32.c
@@ -112,3 +112,8 @@ int qemu_gettimeofday(qemu_timeval *tp)
      Do not set errno on error.  */
   return 0;
 }
+
+void qemu_msleep(int msec)
+{
+    Sleep(msec);
+}
-- 
1.7.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]