diff options
author | Denis Chaplygin | 2017-01-31 12:51:28 +0100 |
---|---|---|
committer | Karel Zak | 2017-01-31 12:51:28 +0100 |
commit | 833f9a7aae713278eec5f85266597482f18c7370 (patch) | |
tree | 86f83f6e5cf4153a53497d89dd727ca3c0dead23 /configure.ac | |
parent | lscpu: Detect Windows Subsystem for Linux (diff) | |
download | kernel-qcow2-util-linux-833f9a7aae713278eec5f85266597482f18c7370.tar.gz kernel-qcow2-util-linux-833f9a7aae713278eec5f85266597482f18c7370.tar.xz kernel-qcow2-util-linux-833f9a7aae713278eec5f85266597482f18c7370.zip |
fallocate: Added posix_fallocate() support.
No all filesystems support Linux fallocate. The new option allow use
posix implementation if necessary.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index fa3e6c831..37599212c 100644 --- a/configure.ac +++ b/configure.ac @@ -1195,6 +1195,34 @@ AS_IF([test "x$build_fallocate" = xyes], [ AC_MSG_RESULT([no])]) ]) +AS_IF([test "x$build_fallocate" = xyes], [ + dnl check for valid posix_fallocate() function + AC_MSG_CHECKING([for valid posix_fallocate() function]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_LINUX_FALLOC_H +# include <linux/falloc.h> +#endif +#ifdef HAVE_FCNTL_H +# include <fcntl.h> +#endif +]],[[ + long ret; + ret = posix_fallocate(0, 0xfffffffful, 0xfffffffful); + if (ret != 0) { + return 1; + } + ]])],[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Have valid posix_fallocate() function])],[ + AC_MSG_RESULT([no])]) +]) + AC_ARG_ENABLE([unshare], AS_HELP_STRING([--disable-unshare], [do not build unshare]), |