From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIKb-00085p-Qs for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWIKZ-0003fU-Jy for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:13 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:44719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIKZ-0003fA-Cc for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:11 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 14 Jun 2011 03:22:02 +0200 Message-Id: <1308014527-60251-6-git-send-email-andreas.faerber@web.de> In-Reply-To: <1308014527-60251-5-git-send-email-andreas.faerber@web.de> References: <1308014527-60251-1-git-send-email-andreas.faerber@web.de> <1308014527-60251-2-git-send-email-andreas.faerber@web.de> <1308014527-60251-3-git-send-email-andreas.faerber@web.de> <1308014527-60251-4-git-send-email-andreas.faerber@web.de> <1308014527-60251-5-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 05/10] configure: Fix check for fdatasync() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexandre Raymond , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Alexandre Raymond Under Darwin, a symbol exists for the fdatasync() function, so that our link test succeeds. However _POSIX_SYNCHRONIZED_IO is set to '-1'. According to POSIX:2008, a value of -1 means the feature is not supported= . A value of 0 means supported at compilation time, and a value greater 0 means supported at both compilation and run time. Enable fdatasync() only if _POSIX_SYNCHRONIZED_IO is '>0'. Signed-off-by: Alexandre Raymond Signed-off-by: Andreas F=C3=A4rber --- configure | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/configure b/configure index c931ae8..6101f4e 100755 --- a/configure +++ b/configure @@ -2461,7 +2461,13 @@ fi fdatasync=3Dno cat > $TMPC << EOF #include -int main(void) { return fdatasync(0); } +int main(void) { +#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 +return fdatasync(0); +#else +#abort Not supported +#endif +} EOF if compile_prog "" "" ; then fdatasync=3Dyes --=20 1.7.5.3