xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / m4 / package_libcdev.m4
index 5156ced652b9adaebb86cd3d10021d555ea31477..14e67e18e7723da8820bb6a8463a0fe3773d01eb 100644 (file)
@@ -67,7 +67,7 @@ AC_DEFUN([AC_HAVE_SENDFILE],
   ])
 
 #
-# Check if we have a getmntent libc call (IRIX, Linux)
+# Check if we have a getmntent libc call (Linux)
 #
 AC_DEFUN([AC_HAVE_GETMNTENT],
   [ AC_MSG_CHECKING([for getmntent ])
@@ -98,3 +98,22 @@ AC_DEFUN([AC_HAVE_GETMNTINFO],
        AC_MSG_RESULT(no))
     AC_SUBST(have_getmntinfo)
   ])
+
+#
+#
+# Check if we have a copy_file_range system call (Linux)
+#
+AC_DEFUN([AC_HAVE_COPY_FILE_RANGE],
+  [ AC_MSG_CHECKING([for copy_file_range])
+    AC_TRY_LINK([
+#define _GNU_SOURCE
+#include <sys/syscall.h>
+#include <unistd.h>
+    ], [
+         syscall(__NR_copy_file_range, 0, 0, 0, 0, 0, 0);
+    ], have_copy_file_range=yes
+       AC_MSG_RESULT(yes),
+       AC_MSG_RESULT(no))
+    AC_SUBST(have_copy_file_range)
+  ])
+