From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1zAv-0004oA-CX for qemu-devel@nongnu.org; Thu, 16 Aug 2012 08:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1zAp-00041I-NO for qemu-devel@nongnu.org; Thu, 16 Aug 2012 08:27:45 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:33213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1zAp-00041E-Gu for qemu-devel@nongnu.org; Thu, 16 Aug 2012 08:27:39 -0400 Message-ID: <502CE72D.1090706@weilnetz.de> Date: Thu, 16 Aug 2012 14:27:25 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1345115718-4054-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1345115718-4054-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.2] osdep: Fix compilation failure on BSD systems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , Anthony Liguori , Corey Bryant , qemu-devel@nongnu.org, patches@linaro.org Am 16.08.2012 13:15, schrieb Peter Maydell: > Fix compilation failure on BSD systems (which don't have > O_DIRECT or O_NOATIME: > osdep.c:116: error: =E2=80=98O_DIRECT=E2=80=99 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: =E2=80=98O_NOATIME=E2=80=99 undeclared (first use i= n 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) > } > =20 > /* Set/unset flags that we can with fcntl */ > - setfl_flags =3D O_APPEND | O_ASYNC | O_DIRECT | O_NOATIME | O_NONB= LOCK; > + setfl_flags =3D O_APPEND | O_ASYNC | O_NONBLOCK; > +#ifdef O_NOATIME > + setfl_flags |=3D O_NOATIME; > +#endif > +#ifdef O_DIRECT > + setfl_flags |=3D O_DIRECT; > +#endif > dup_flags &=3D ~setfl_flags; > dup_flags |=3D (flags & setfl_flags); > if (fcntl(ret, F_SETFL, dup_flags) =3D=3D -1) { Would O_DSYNC be a good replacement here for an undefined O_DIRECT? block/raw-posix.c does it like that. What about defining O_NOATIME and O_DIRECT in qemu-common.h when needed (like it is done for O_BINARY)? But I don't want to delay 1.2, therefore Reviewed-by: Stefan Weil Regards, Stefan W.