Merge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev
[xfstests-dev.git] / m4 / package_libcdev.m4
index d612da2721ba83a2731df455301a36d6c6324754..5156ced652b9adaebb86cd3d10021d555ea31477 100644 (file)
@@ -8,7 +8,7 @@ AC_DEFUN([AC_HAVE_FADVISE],
 #define _FILE_OFFSET_BITS 64
 #include <fcntl.h>
     ], [
-       posix_fadvise(0, 1, 0, 0);
+       posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
     ], have_fadvise=yes
        AC_MSG_RESULT(yes),
        AC_MSG_RESULT(no))
@@ -65,3 +65,36 @@ AC_DEFUN([AC_HAVE_SENDFILE],
        AC_MSG_RESULT(no))
     AC_SUBST(have_sendfile)
   ])
+
+#
+# Check if we have a getmntent libc call (IRIX, 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)
+  ])