2006-08-29 Paul Eggert <eggert@cs.ucla.edu>
+ * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
+ work around a Mac OS X porting problem reported by Bruno Haible in
+ <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
+ (print_statfs): Use them.
+
* bootstrap.conf (gnulib_modules): Add isapipe.
* src/tail.c: Include isapipe.h.
(IS_PIPE_LIKE_FILE_TYPE): Remove.
# endif
#endif
"
- AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
- AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
+ dnl Keep this long conditional in sync with the USE_STATVFS conditional
+ dnl in ../src/stat.c.
+ if test $ac_cv_header_sys_statvfs_h = yes &&
+ { AC_CHECK_MEMBERS(
+ [struct statvfs.f_basetype,
+ struct statvfs.f_fstypename,
+ struct statvfs.f_type],,,
+ [$statxfs_includes])
+ test $ac_cv_member_struct_statvfs_f_basetype = yes ||
+ test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
+ { test $ac_cv_member_struct_statvfs_f_type = yes &&
+ test $ac_cv_member_struct_statfs_f_fstypename != yes; }; }; then
+ AC_CHECK_MEMBERS(
+ [struct statvfs.f_fsid.__val, struct statvfs.f_fsid.val,
+ struct statvfs.f_namelen, struct statvfs.f_namemax],,,
+ [$statxfs_includes])
+ else
+ AC_CHECK_MEMBERS(
+ [struct statfs.f_basetype, struct statfs.f_fsid.__val,
+ struct statfs.f_fsid.val, struct statfs.f_namelen,
+ struct statfs.f_namemax, struct statfs.f_type],,,
+ [$statxfs_includes])
+ fi
])
#include <config.h>
+/* Keep this conditional in sync with the similar conditional in
+ ../m4/stat-prog.m4. */
#if (STAT_STATVFS \
&& (HAVE_STRUCT_STATVFS_F_BASETYPE || HAVE_STRUCT_STATVFS_F_FSTYPENAME \
|| (! HAVE_STRUCT_STATFS_F_FSTYPENAME && HAVE_STRUCT_STATVFS_F_TYPE)))
#if USE_STATVFS
# define STRUCT_STATVFS struct statvfs
# define HAVE_STRUCT_STATXFS_F_FSID___VAL HAVE_STRUCT_STATVFS_F_FSID___VAL
+# define HAVE_STRUCT_STATXFS_F_FSID_VAL HAVE_STRUCT_STATVFS_F_FSID_VAL
# define HAVE_STRUCT_STATXFS_F_TYPE HAVE_STRUCT_STATVFS_F_TYPE
# if HAVE_STRUCT_STATVFS_F_NAMEMAX
# define SB_F_NAMEMAX(S) ((S)->f_namemax)
# define f_ffree free_nodes
# define STRUCT_STATVFS struct fs_info
# define HAVE_STRUCT_STATXFS_F_FSID___VAL 0
+# define HAVE_STRUCT_STATXFS_F_FSID_VAL 0
# define STATFS_FRSIZE(S) ((S)->block_size)
# else
# define STRUCT_STATVFS struct statfs
# define HAVE_STRUCT_STATXFS_F_FSID___VAL HAVE_STRUCT_STATFS_F_FSID___VAL
+# define HAVE_STRUCT_STATXFS_F_FSID_VAL HAVE_STRUCT_STATFS_F_FSID_VAL
# define STATFS_FRSIZE(S) 0
# endif
#endif
+#if HAVE_STRUCT_STATXFS_F_FSID___VAL
+# define FSID_VAL __val
+#elif HAVE_STRUCT_STATXFS_F_FSID_VAL
+# define FSID_VAL val
+#endif
+
#ifdef SB_F_NAMEMAX
# define OUT_NAMEMAX out_uint
#else
case 'i':
{
-#if HAVE_STRUCT_STATXFS_F_FSID___VAL
- uintmax_t val0 = statfsbuf->f_fsid.__val[0];
- uintmax_t val1 = statfsbuf->f_fsid.__val[1];
+#ifdef FSID_VAL
+ uintmax_t val0 = statfsbuf->f_fsid.FSID_VAL[0];
+ uintmax_t val1 = statfsbuf->f_fsid.FSID_VAL[1];
uintmax_t fsid =
(val1
- + (sizeof statfsbuf->f_fsid.__val[1] < sizeof fsid
- ? val0 << (CHAR_BIT * sizeof statfsbuf->f_fsid.__val[1])
+ + (sizeof statfsbuf->f_fsid.FSID_VAL[1] < sizeof fsid
+ ? val0 << (CHAR_BIT * sizeof statfsbuf->f_fsid.FSID_VAL[1])
: 0));
#else
uintmax_t fsid = statfsbuf->f_fsid;