about summary refs log tree commit diff
path: root/io/tst-statvfs.c
Commit message (Collapse)AuthorAgeFilesLines
* io/tst-statvfs: fix statfs().f_type comparison test on some archesнаб2023-08-151-1/+1
| | | | | | | | | On i686 f_type is an i32 so the test fails when that has the top bit set. Explicitly cast to u32. Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* linux: statvfs: allocate spare for f_typeнаб2023-08-081-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the only missing part in struct statvfs. The LSB calls [f]statfs() deprecated, and its weird types are definitely off-putting. However, its use is required to get f_type. Instead, allocate one of the six spares to f_type, copied directly from struct statfs. This then becomes a small glibc extension to the standard interface on Linux and the Hurd, instead of two different interfaces, one of which is quite odd due to being an ABI type, and there no longer is any reason to use statfs(). The underlying kernel type is a mess, but all architectures agree on u32 (or more) for the ABI, and all filesystem magicks are 32-bit integers. We don't lose any generality by using u32, and by doing so we both make the API consistent with the Hurd, and allow C++ switch(f_type) { case RAMFS_MAGIC: ...; } Also fix tst-statvfs so that it actually fails; as it stood, all it did was return 0 always. Test statfs()' and statvfs()' f_types are the same. Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update.Ulrich Drepper2003-10-271-0/+30
* sysdeps/unix/sysv/linux/internal_statvfs.c (__internal_statvfs): Avoid infinite loops in case the mounts file is hosed. * io/Makefile: Add rules to build and run tst-statvfs. * io/tst-statvfs.c: New file.