DEVEL15-ukernel-use-fsblkcnt-20090513
authorDerrick Brashear <shadow@dementia.org>
Wed, 13 May 2009 22:35:08 +0000 (22:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 13 May 2009 22:35:08 +0000 (22:35 +0000)
LICENSE IPL10
FIXES 124681

blkcnt_t doesn't exist on fbsd, macos 10.3, and isn't really the right type.
this is the right type, but also can be missing. test appropriately.

(cherry picked from commit 070f02923cfa4e01ccb754928cdd4d02bec48720)

acinclude.m4
src/afs/UKERNEL/sysincludes.h

index 4a2f269..ae20bde 100644 (file)
@@ -1558,9 +1558,22 @@ AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h)
 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h poll.h sys/pag.h)
 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h sys/user.h)
-AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h values.h)
+AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h values.h sys/statvfs.h sys/statfs.h sys/bitypes.h)
 AC_CHECK_HEADERS(linux/errqueue.h,,,[#include <linux/types.h>])
 
+AC_CHECK_TYPES([fsblkcnt_t],,,[
+#include <sys/types.h>
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+])
+
 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
        HAVE_PAM="yes"
 else
index 499d1e3..cc61bbd 100644 (file)
 #endif
 #endif /* AFS_USR_DARWIN_ENV || AFS_USR_FBSD_ENV */
 
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
+#ifndef HAVE_FSBLKCNT_T
+typedef unsigned int fsblkcnt_t;
+#endif
+
 #ifdef AFS_AFSDB_ENV
 #include <arpa/nameser.h>
 #include <resolv.h>
@@ -1038,7 +1052,7 @@ struct usr_vattr {
     struct timeval va_ctime;
     dev_t va_rdev;
     unsigned long va_blocksize;
-    blkcnt_t va_blocks;
+    fsblkcnt_t va_blocks;
     unsigned long va_vcode;
 };