btrfs: test delayed subvolume deletion on mount and remount
[xfstests-dev.git] / m4 / package_libcdev.m4
index a66ae4791b97cee9cfdb7b38028cc32b8b9cbbf7..14e67e18e7723da8820bb6a8463a0fe3773d01eb 100644 (file)
@@ -65,3 +65,55 @@ AC_DEFUN([AC_HAVE_SENDFILE],
        AC_MSG_RESULT(no))
     AC_SUBST(have_sendfile)
   ])
+
+#
+# Check if we have a getmntent libc call (Linux)
+#
+AC_DEFUN([AC_HAVE_GETMNTENT],
+  [ AC_MSG_CHECKING([for getmntent ])
+    AC_TRY_COMPILE([
+#include <stdio.h>
+#include <mntent.h>
+    ], [
+         getmntent(0);
+    ], have_getmntent=yes
+       AC_MSG_RESULT(yes),
+       AC_MSG_RESULT(no))
+    AC_SUBST(have_getmntent)
+  ])
+
+#
+# Check if we have a getmntinfo libc call (FreeBSD, Mac OS X)
+#
+AC_DEFUN([AC_HAVE_GETMNTINFO],
+  [ AC_MSG_CHECKING([for getmntinfo ])
+    AC_TRY_COMPILE([
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+    ], [
+         getmntinfo(0, 0);
+    ], have_getmntinfo=yes
+       AC_MSG_RESULT(yes),
+       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)
+  ])
+