From patchwork Thu Aug 16 11:15:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 10767 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5ABA723E02 for ; Thu, 16 Aug 2012 11:15:32 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0900DA18413 for ; Thu, 16 Aug 2012 11:15:31 +0000 (UTC) Received: by iadj38 with SMTP id j38so406882iad.11 for ; Thu, 16 Aug 2012 04:15:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=H1O7mqzwzPIxUO3oaLtoNJBuqY7lvXkhKjyleT+nwRc=; b=S0l17XwgrQFNWRT2jSwX5Xi4By5WwkbnQnf7Ucu/wkarmq6yt0a0BWsGBZoQD/3pqr Oh/vh+R/Vop29e+QwQBoIdTUIdYfHknDNvPWTwmxCaSFMceLCW0OgKau4gIgsNGw/2VS IZqGhD/thsh5rMGLzqhykpKjq2n6hUO+nzXnbGh1Q70jtxks+V6gRfsKKkDePrNuiulW KhxYip6WlhwXykVSzlrTfLEpszOh84LmmNBvrPa135RQ7ATWkG9VNJ0T/jnmXLyodrln LHJr9twjXv5Opb2a74uyf6YppS47x6IVmRzkVpTF41S+otvmtwzZKVEp1nHuLpXcXJCW I92w== Received: by 10.42.249.205 with SMTP id ml13mr676974icb.49.1345115731313; Thu, 16 Aug 2012 04:15:31 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp119790igc; Thu, 16 Aug 2012 04:15:30 -0700 (PDT) Received: by 10.14.204.72 with SMTP id g48mr1012971eeo.45.1345115729873; Thu, 16 Aug 2012 04:15:29 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id 1si2720455eee.49.2012.08.16.04.15.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Aug 2012 04:15:29 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1T1y2o-00013p-K5; Thu, 16 Aug 2012 12:15:18 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Corey Bryant , Kevin Wolf , Anthony Liguori Subject: [PATCH for-1.2] osdep: Fix compilation failure on BSD systems Date: Thu, 16 Aug 2012 12:15:18 +0100 Message-Id: <1345115718-4054-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlPZzNgX8HUVmrgDZYGqCek4sp9endl4Kv1L8IfsB34eqbaA8XikIrGv4/uSkE4dNK3pJar Fix compilation failure on BSD systems (which don't have O_DIRECT or O_NOATIME: osdep.c:116: error: ‘O_DIRECT’ undeclared (first use in this function) osdep.c:116: error: (Each undeclared identifier is reported only once osdep.c:116: error: for each function it appears in.) osdep.c:116: error: ‘O_NOATIME’ undeclared (first use in this function) Signed-off-by: Peter Maydell --- PS: Do we care about O_DSYNC, O_RSYNC, O_SYNC? POSIX says those can be used via fcntl() too... osdep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osdep.c b/osdep.c index 5b78cee..3b25297 100644 --- a/osdep.c +++ b/osdep.c @@ -113,7 +113,13 @@ static int qemu_dup_flags(int fd, int flags) } /* Set/unset flags that we can with fcntl */ - setfl_flags = O_APPEND | O_ASYNC | O_DIRECT | O_NOATIME | O_NONBLOCK; + setfl_flags = O_APPEND | O_ASYNC | O_NONBLOCK; +#ifdef O_NOATIME + setfl_flags |= O_NOATIME; +#endif +#ifdef O_DIRECT + setfl_flags |= O_DIRECT; +#endif dup_flags &= ~setfl_flags; dup_flags |= (flags & setfl_flags); if (fcntl(ret, F_SETFL, dup_flags) == -1) {