summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2014-09-29 17:12:59 +0200
committerPeter Maydell <peter.maydell@linaro.org>2014-09-29 16:28:24 +0100
commited9114356b587b362f5ed10e75366a4f07ed32af (patch)
tree24a063327e9e7e424cb7ef04389df8dd64b0c4b9 /configure
parent0ebcc564533454853e66cbe665a0d23bf7199834 (diff)
downloadqemu-ed9114356b587b362f5ed10e75366a4f07ed32af.tar.gz
qemu-ed9114356b587b362f5ed10e75366a4f07ed32af.tar.bz2
qemu-ed9114356b587b362f5ed10e75366a4f07ed32af.zip
raw-posix: Fix build without posix_fallocate()
Check for the presence of posix_fallocate() in configure and only compile in support for PREALLOC_MODE_FALLOC when it's there. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure b/configure
index a2c0f2a02a..681abfc669 100755
--- a/configure
+++ b/configure
@@ -3308,6 +3308,21 @@ if compile_prog "" "" ; then
fallocate_punch_hole=yes
fi
+# check for posix_fallocate
+posix_fallocate=no
+cat > $TMPC << EOF
+#include <fcntl.h>
+
+int main(void)
+{
+ posix_fallocate(0, 0, 0);
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ posix_fallocate=yes
+fi
+
# check for sync_file_range
sync_file_range=no
cat > $TMPC << EOF
@@ -4522,6 +4537,9 @@ fi
if test "$fallocate_punch_hole" = "yes" ; then
echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak
fi
+if test "$posix_fallocate" = "yes" ; then
+ echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
+fi
if test "$sync_file_range" = "yes" ; then
echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
fi