From 070f02923cfa4e01ccb754928cdd4d02bec48720 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 13 May 2009 22:34:56 +0000 Subject: [PATCH] ukernel-use-fsblkcnt-20090513 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. --- acinclude.m4 | 15 ++++++++++++++- src/afs/UKERNEL/sysincludes.h | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 1d12f4512..35dc400f2 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1523,9 +1523,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 ]) +AC_CHECK_TYPES([fsblkcnt_t],,,[ +#include +#ifdef HAVE_SYS_BITYPES_H +#include +#endif +#ifdef HAVE_SYS_STATFS_H +#include +#endif +#ifdef HAVE_SYS_STATVFS_H +#include +#endif +]) + dnl Don't build PAM on IRIX; the interface doesn't work for us. if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then case $AFS_SYSNAME in diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index 499d1e388..cc61bbdba 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -140,6 +140,20 @@ #endif #endif /* AFS_USR_DARWIN_ENV || AFS_USR_FBSD_ENV */ +#ifdef HAVE_SYS_BITYPES_H +#include +#endif +#ifdef HAVE_SYS_STATFS_H +#include +#endif +#ifdef HAVE_SYS_STATVFS_H +#include +#endif + +#ifndef HAVE_FSBLKCNT_T +typedef unsigned int fsblkcnt_t; +#endif + #ifdef AFS_AFSDB_ENV #include #include @@ -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; }; -- 2.39.5