Major new features:
- [Add new features here]
+* struct statvfs now has an f_type member, equal to the f_type statfs member;
+ on the Hurd this was always available under a reserved name,
+ and under Linux a spare has been allocated: it was always zero
+ in previous versions of glibc, and zero is not a valid result.
Deprecated and removed features, and other changes affecting compatibility:
#include <stdio.h>
+#include <sys/statfs.h>
#include <sys/statvfs.h>
+#include <support/check.h>
/* This test cannot detect many errors. But it will fail if the
for (int i = 1; i < argc; ++i)
{
struct statvfs st;
- if (statvfs (argv[i], &st) != 0)
- printf ("%s: failed (%m)\n", argv[i]);
- else
- printf ("%s: free: %llu, mandatory: %s\n", argv[i],
- (unsigned long long int) st.f_bfree,
+ struct statfs stf;
+ TEST_COMPARE (statvfs (argv[i], &st), 0);
+ TEST_COMPARE (statfs (argv[i], &stf), 0);
+ TEST_COMPARE (st.f_type, stf.f_type);
+ printf ("%s: free: %llu, mandatory: %s, tp=%x\n", argv[i],
+ (unsigned long long int) st.f_bfree,
#ifdef ST_MANDLOCK
- (st.f_flag & ST_MANDLOCK) ? "yes" : "no"
+ (st.f_flag & ST_MANDLOCK) ? "yes" : "no",
#else
- "no"
+ "no",
#endif
- );
+ st.f_type);
}
return 0;
}
#endif
unsigned long int f_flag;
unsigned long int f_namemax;
- int __f_spare[6];
+ unsigned int f_type;
+ int __f_spare[5];
};
#ifdef __USE_LARGEFILE64
#endif
unsigned long int f_flag;
unsigned long int f_namemax;
- int __f_spare[6];
+ unsigned int f_type;
+ int __f_spare[5];
};
#endif
buf->__f_unused = 0;
#endif
buf->f_namemax = fsbuf->f_namelen;
+ buf->f_type = fsbuf->f_type;
memset (buf->__f_spare, '\0', sizeof (buf->__f_spare));
/* What remains to do is to fill the fields f_favail and f_flag. */
buf->__f_unused = 0;
#endif
buf->f_namemax = fsbuf->f_namelen;
+ buf->f_type = fsbuf->f_type;
memset (buf->__f_spare, '\0', sizeof (buf->__f_spare));
/* What remains to do is to fill the fields f_favail and f_flag. */