summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-02-28 18:59:37 -0800
committerZorro Lang <zlang@kernel.org>2023-03-02 17:18:08 +0800
commitbf183828b8f4c3caf3d3fd1f96d9f396db7508e5 (patch)
tree2eaa2a1f14c23f4c1bd7eb0bb8495072f1861e48 /m4
parentf02d41a7b5cade6bb7f9b4009e787b284283eccf (diff)
fsx: support FIEXCHANGE_RANGE
Upgrade fsx to support exchanging file contents. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'm4')
-rw-r--r--m4/package_libcdev.m420
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index 98572aec..b41c087b 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -154,3 +154,23 @@ AC_DEFUN([AC_HAVE_RLIMIT_NOFILE],
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_rlimit_nofile)
])
+
+#
+# Check if we have a FIEXCHANGE_RANGE ioctl (Linux)
+#
+AC_DEFUN([AC_HAVE_FIEXCHANGE],
+ [ AC_MSG_CHECKING([for FIEXCHANGE_RANGE])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#define _GNU_SOURCE
+#include <sys/syscall.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <linux/fs.h>
+#include <linux/fiexchange.h>
+ ]], [[
+ struct file_xchg_range fxr;
+ ioctl(-1, FIEXCHANGE_RANGE, &fxr);
+ ]])],[have_fiexchange=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+ AC_SUBST(have_fiexchange)
+ ])