glocalfile: Support statvfs.f_type

This is another way to get the file system type from `statvfs()`, newly
added in glibc 2.39
(https://lwn.net/ml/libc-alpha/38790850.J2Yia2DhmK@pinacolada/).

This hasn’t been tested with glibc 2.39 as I don’t have it, but the
change seems fairly straightforward.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-02-07 10:34:59 +00:00
parent 20c7479cc8
commit 9eeb8a87d3
2 changed files with 3 additions and 0 deletions

View File

@ -1089,6 +1089,8 @@ g_local_file_query_filesystem_info (GFile *file,
fstype = statfs_buffer.f_fstypename;
#elif defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
fstype = statfs_buffer.f_basetype;
#elif defined(HAVE_STRUCT_STATVFS_F_TYPE)
fstype = get_fs_type (statfs_buffer.f_type);
#else
fstype = NULL;
#endif

View File

@ -507,6 +507,7 @@ struct_members = [
#include <dirent.h>''' ],
[ 'statvfs', 'f_basetype', '#include <sys/statvfs.h>' ],
[ 'statvfs', 'f_fstypename', '#include <sys/statvfs.h>' ],
[ 'statvfs', 'f_type', '#include <sys/statvfs.h>' ],
[ 'tm', 'tm_gmtoff', '#include <time.h>' ],
[ 'tm', '__tm_gmtoff', '#include <time.h>' ],
]