[SCM] Samba Shared Repository - branch master updated - 0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b

Tim Prouty tprouty at samba.org
Mon Oct 13 21:28:45 GMT 2008


The branch, master has been updated
       via  0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b (commit)
      from  783818d956fd6e22d1affae808f240b6189e3140 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0a33d8bd312cc4497d08bbe0f4dd2abcce67bd0b
Author: Tim Prouty <tprouty at samba.org>
Date:   Mon Oct 13 11:50:27 2008 -0700

    Check for f_frsize when using statvfs
    
    Add a configure test for the availability of f_frsize in struct
    statvfs (for broken platforms that define statvfs but still have
    f_bsize/f_iosize). Ported from source3's fsusage:
    commit 472519eb6941bc0972212cc416ab89801fe3ee0c

-----------------------------------------------------------------------

Summary of changes:
 lib/util/fsusage.c  |    5 +++++
 lib/util/fsusage.m4 |   31 +++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/fsusage.c b/lib/util/fsusage.c
index 43c8787..30f9f9c 100644
--- a/lib/util/fsusage.c
+++ b/lib/util/fsusage.c
@@ -124,8 +124,13 @@ _PUBLIC_ int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize)
 #endif /* STAT_STATFS4 */
 
 #if defined(STAT_STATVFS) || defined(STAT_STATVFS64)		/* SVR4 */
+#ifdef HAVE_FRSIZE
 # define CONVERT_BLOCKS(B) \
 	adjust_blocks ((uint64_t)(B), fsd.f_frsize ? (uint64_t)fsd.f_frsize : (uint64_t)fsd.f_bsize, (uint64_t)512)
+#else
+# define CONVERT_BLOCKS(B) \
+	adjust_blocks ((uint64_t)(B), (uint64_t)fsd.f_bsize, (uint64_t)512)
+#endif
 
 #ifdef STAT_STATVFS64
 	struct statvfs64 fsd;
diff --git a/lib/util/fsusage.m4 b/lib/util/fsusage.m4
index 6d5d13f..5023c36 100644
--- a/lib/util/fsusage.m4
+++ b/lib/util/fsusage.m4
@@ -54,6 +54,37 @@ if test $space = no; then
   fi
 fi
 
+# fsusage.c assumes that statvfs has an f_frsize entry. Some weird
+# systems use f_bsize.
+AC_CACHE_CHECK([that statvfs.f_frsize works],samba_cv_frsize, [
+    AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/statvfs.h>],[struct statvfs buf; buf.f_frsize = 0],
+	samba_cv_frsize=yes,samba_cv_frsize=no)])
+if test x"$samba_cv_frsize" = x"yes"; then
+    AC_DEFINE(HAVE_FRSIZE, 1, [Whether statvfs.f_frsize exists])
+fi
+
+
+# if test $fu_cv_sys_stat_statvfs64 = yes || test $fu_cv_sys_stat_statvfs = yes ; then
+#   AC_MSG_CHECKING([for struct statvfs with statvfs.f_frsize (SVR4)])
+#   AC_CACHE_VAL(fu_cv_struct_statvfs_f_frsize,
+#   [AC_TRY_RUN([
+# #include <sys/statvfs.h>
+#   main ()
+#   {
+#   struct statvfs fsd;
+#   fsd.f_frsize = 0;
+#   exit (statvfs (".", &fsd));
+#   }],
+#   fu_cv_struct_statvfs_f_frsize=yes,
+#   fu_cv_struct_statvfs_f_frsize=no,
+#   fu_cv_struct_statvfs_f_frsize=no)])
+#   AC_MSG_RESULT($fu_cv_sys_stat_statvfs_f_frsize)
+#   if test $fu_cv_struct_statvfs_f_frsize = yes; then
+#     AC_DEFINE(HAVE_STRUCT_STATVFS_F_FRSIZE,1,[Whether struct statvfs has f_frsize property])
+#   fi
+# fi
+
 if test $space = no; then
   # DEC Alpha running OSF/1
   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])


-- 
Samba Shared Repository


More information about the samba-cvs mailing list