From 06b9a39d7ca8ccf9ec6ba35a31689174ca6fdf25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sun, 1 Jun 1997 23:12:16 +0200
Subject: [PATCH] Added some more statfs tests: On SGI statfs() takes 4 args,
 and the statfs-struct doesn't have the f_bavail member.

Rev: src/modules/files/configure.in:1.20
---
 src/modules/files/configure.in | 52 ++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/src/modules/files/configure.in b/src/modules/files/configure.in
index 489e39a2e2..d3c840e8ca 100644
--- a/src/modules/files/configure.in
+++ b/src/modules/files/configure.in
@@ -105,6 +105,58 @@ fi
 
 else :; fi
 
+if test x$ac_cv_func_statfs = xyes ; then
+  AC_MSG_CHECKING(if statfs takes 2(Standard) or 4(SGI) arguments)
+  AC_CACHE_VAL(pike_cv_func_sgi_statfs, [
+    AC_TRY_RUN([
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+
+int main()
+{
+  exit(0);
+
+  /* NOT REACHED */
+  statfs((char *)0, (struct statfs *)0);
+}
+],pike_cv_func_sgi_statfs=no,pike_cv_func_sgi_statfs=yes)
+  ])
+  if test x$pike_cv_func_sgi_statfs = xyes ; then
+    AC_MSG_RESULT(SGI style)
+    AC_DEFINE(HAVE_SGI_STATFS)
+  else
+    AC_MSG_RESULT(Standard)
+  fi
+
+  AC_MSG_CHECKING(if the struct statfs has the member f_bavail)
+  AC_CACHE_VAL(pike_cv_struct_statfs_f_bavail, [
+    AC_TRY_COMPILE([
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+    ], [
+      int main(int argc, char **argv)
+      {
+        struct statfs st;
+	st.f_bavail = 0;
+        return(st.f_bavail);
+      }
+    ], [ pike_cv_struct_statfs_f_bavail=yes ],
+    [ pike_cv_struct_statfs_f_bavail=no ])
+  ])
+  AC_MSG_RESULT($pike_cv_struct_statfs_f_bavail)
+  if test x$pike_cv_struct_statfs_f_bavail = xyes; then
+    AC_DEFINE(HAVE_STATFS_F_BAVAIL)
+  else :; fi
+else :; fi
+
 AC_MSG_CHECKING(for working (and failsafe) strerror)
 AC_CACHE_VAL(pike_cv_func_failsafe_strerror,
 [
-- 
GitLab