From patchwork Mon Aug 15 21:08:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 110107 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DCDA8B6F70 for ; Tue, 16 Aug 2011 08:10:30 +1000 (EST) Received: from localhost ([::1]:52542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qt4QO-0006mF-KL for incoming@patchwork.ozlabs.org; Mon, 15 Aug 2011 17:10:20 -0400 Received: from eggs.gnu.org ([140.186.70.92]:49398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qt4Q1-0005BC-7X for qemu-devel@nongnu.org; Mon, 15 Aug 2011 17:09:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qt4Pp-0000IH-Dx for qemu-devel@nongnu.org; Mon, 15 Aug 2011 17:09:46 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:56686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qt4Pp-0000G7-8z for qemu-devel@nongnu.org; Mon, 15 Aug 2011 17:09:45 -0400 Received: by mail-pz0-f42.google.com with SMTP id 37so9398728pzk.29 for ; Mon, 15 Aug 2011 14:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=piTB2pz/UXECyRFkeej+USy6BLAb/0n+3DRsTH2LkFk=; b=rMhZdlbWH5kBO6OJHjax9pGJ8Fho6ZUROsCT4VEi1bDbSSaHu0npfthpLR6bvqLM6X lSD+rzENQiwuSye2e0N8+L8MLxcH3hZCGiKDTp7KQU93WQtomqYXvDl0GDUOR3SV4XmJ blC40n5XtCoVD0ltxa/XcjjcB3AmpSFTAVTK0= Received: by 10.143.62.10 with SMTP id p10mr2266858wfk.191.1313442584986; Mon, 15 Aug 2011 14:09:44 -0700 (PDT) Received: from localhost.localdomain ([216.123.155.199]) by mx.google.com with ESMTPS id i8sm1064587pbi.92.2011.08.15.14.09.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Aug 2011 14:09:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 15 Aug 2011 14:08:34 -0700 Message-Id: <1313442520-12062-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1313442520-12062-1-git-send-email-pbonzini@redhat.com> References: <1313442520-12062-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.42 Subject: [Qemu-devel] [RFC PATCH 07/13] osdep: add qemu_msleep X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini --- 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 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); +}