From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NI4uS-0008Hb-Lt for qemu-devel@nongnu.org; Tue, 08 Dec 2009 13:35:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NI4uO-0008CP-Or for qemu-devel@nongnu.org; Tue, 08 Dec 2009 13:35:40 -0500 Received: from [199.232.76.173] (port=37116 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI4uO-0008C3-IQ for qemu-devel@nongnu.org; Tue, 08 Dec 2009 13:35:36 -0500 Received: from mail-yx0-f188.google.com ([209.85.210.188]:45930) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NI4uO-00011c-En for qemu-devel@nongnu.org; Tue, 08 Dec 2009 13:35:36 -0500 Received: by yxe26 with SMTP id 26so5408327yxe.4 for ; Tue, 08 Dec 2009 10:35:35 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <4AC3AE97.3000400@codemonkey.ws> From: Blue Swirl Date: Tue, 8 Dec 2009 20:35:15 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pierre Riteau Cc: G 3 , qemu-devel@nongnu.org On Tue, Dec 8, 2009 at 4:35 PM, Pierre Riteau wrot= e: > On 1 oct. 2009, at 18:13, Blue Swirl wrote: > >> On Thu, Oct 1, 2009 at 6:30 PM, G 3 wrote: >>> On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: >>> >>> G 3 wrote: >>> >>> This patch fixes a problem in the file cutils.c that prevents qemu from >>> being built on Mac OS X. This patch makes sure fsync is used instead. >>> >>> What is this against? =C2=A0It doesn't apply to git. >>> >>> This is against the savannah >>> repository: git://git.savannah.nongnu.org/qemu.git. Is this the wrong >>> repository? >> >> The patch should not be needed since >> 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a problem? > > Sorry to dig up this old thread, but I just tried compiling qemu on my Ma= c and I see a warning when it compiles: > cutils.c: In function =E2=80=98qemu_fdatasync=E2=80=99: > cutils.c:128: warning: implicit declaration of function =E2=80=98fdatasyn= c=E2=80=99 > > I'm running OS X 10.6.2 with Xcode 3.2.1. > > Why this behavior? Because the configure check introduced in 5f6b9e finds= that fdatasync is available. > Although the fdatasync function is not referenced in the standard include= s (hence the warning), it is present as a syscall: > /usr/include/sys/syscall.h:#define =C2=A0 =C2=A0 =C2=A0SYS_fdatasync =C2= =A0 =C2=A0 =C2=A0187 > Moreover, a fdatasync symbol is available through libSystem (which is why= the linking done by the configure check works). > > It's not clear what is the best solution here. Googling the issue, some p= rojects add the fdatasync prototype to their headers to avoid warnings. > Other assume that fdatasync could be a noop and fall back to fsync. > > I would go with the second second: the function is not defined, there is = no man page, let's assume it doesn't work. > To fix the configure check we can simply add -Werror to the compile_prog = cflags (I will send a patch if you agree with this). I'd rather add something like #ifdef __APPLE__ exit(1); #endif (or the shell equivalent for configure) and a comment with your explanation= .