+
+#
+#
+# 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)
+ ])
+