From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MI63K-0001Tv-0N for qemu-devel@nongnu.org; Sat, 20 Jun 2009 15:16:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MI63F-0001R6-53 for qemu-devel@nongnu.org; Sat, 20 Jun 2009 15:16:37 -0400 Received: from [199.232.76.173] (port=50236 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MI63E-0001Qp-HY for qemu-devel@nongnu.org; Sat, 20 Jun 2009 15:16:32 -0400 Received: from verein.lst.de ([213.95.11.210]:58639) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MI63D-0004C1-Qk for qemu-devel@nongnu.org; Sat, 20 Jun 2009 15:16:32 -0400 Date: Sat, 20 Jun 2009 21:16:29 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH] replace O_SYNC with O_FSYNC Message-ID: <20090620191629.GB25835@lst.de> References: <20f282157f4df2f513fdb51427be26c7@hotpop.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20f282157f4df2f513fdb51427be26c7@hotpop.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: m a Cc: qemu-devel@nongnu.org On Fri, Jun 19, 2009 at 10:22:07PM -0400, m a wrote: > This patch replaces O_SYNC with O_FSYNC. These two flags do the same > thing, but only O_FSYNC is available in Mac OS 10.3 and under. It only > replaces O_SYNC if it doesn't exist. This patch allows the file > block-raw-posix.c to compile on Mac OS 10.3. This is my first time > submitting a patch, so there might have been a few mistakes made. But O_SYNC is a standard posix flag, while O_FSYNC appears to be a BSD extension. Also the actual code uses O_DSYNC anyway, which also is in Posix but not actually natively supported by some OSes, e.g. Linux (but still provided in libc there). > --- block-raw-posix.c Wed May 20 16:46:58 2009 > +++ block-raw-posix (updated).c Fri Jun 19 22:01:07 2009 > @@ -73,6 +73,12 @@ > > +// O_SYNC isn't available on Mac OS 10.3 and under > +// O_SYNC and O_FSYNC do the same thing > +#ifndef O_SYNC > +#define O_SYNC O_FSYNC > +#endif > + > /* OS X does not have O_DSYNC */ > #ifndef O_DSYNC > #define O_DSYNC O_SYNC So if the code here is correct and Darwin is the only supported OS where O_DSYNC is missing we could just replace the O_SYNC in the last line with O_FSYNC.