From 5f6b9e8fd5b9516170e582d9b6c27c98519a8031 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sun, 20 Sep 2009 06:56:26 +0000 Subject: [PATCH] Probe for fdatasync() Signed-off-by: Blue Swirl --- configure | 16 ++++++++++++++++ cutils.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d752009d9..62dccd267 100755 --- a/configure +++ b/configure @@ -1625,6 +1625,18 @@ if compile_prog "" "" ; then need_offsetof=no fi +########################################## +# check if we have fdatasync + +fdatasync=no +cat > $TMPC << EOF +#include +int main(void) { return fdatasync(0); } +EOF +if compile_prog "" "" ; then + fdatasync=yes +fi + # End of CC checks # After here, no more $cc or $ld runs @@ -1738,6 +1750,7 @@ echo "Install blobs $blobs" echo "KVM support $kvm" echo "fdt support $fdt" echo "preadv support $preadv" +echo "fdatasync $fdatasync" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -1928,6 +1941,9 @@ fi if test "$need_offsetof" = "yes" ; then echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak fi +if test "$fdatasync" = "yes" ; then + echo "CONFIG_FDATASYNC=y" >> $config_host_mak +fi # XXX: suppress that if [ "$bsd" = "yes" ] ; then diff --git a/cutils.c b/cutils.c index 7a2234646..2365e68d9 100644 --- a/cutils.c +++ b/cutils.c @@ -124,7 +124,7 @@ int qemu_fls(int i) */ int qemu_fdatasync(int fd) { -#ifdef _POSIX_SYNCHRONIZED_IO +#ifdef CONFIG_FDATASYNC return fdatasync(fd); #else return fsync(fd); -- 2.39.2