From 5a3c09023e9dc719dc6a365593ed10687d369095 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 31 Jan 2024 07:17:40 +0100 Subject: [PATCH] preload: wrap fstatfs() and statfs() on musl musl has both of these functions (though not the separate "64" variants that glibc). Thanks to Alyssa Ross @alyssais for finding this and the initial patch! --- src/libumockdev-preload.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libumockdev-preload.c b/src/libumockdev-preload.c index e83b06f..7e1ea6f 100644 --- a/src/libumockdev-preload.c +++ b/src/libumockdev-preload.c @@ -1444,6 +1444,8 @@ int statx(int dirfd, const char *pathname, int flags, unsigned mask, struct stat return r; } +#endif /* __GLIBC__ */ + static bool is_dir_or_contained(const char *path, const char *dir, const char *subdir) { if (!path || !dir) @@ -1490,7 +1492,9 @@ int fstatfs ## suffix(int fd, struct statfs ## suffix *buf) \ } WRAP_FSTATFS(); +#ifdef __GLIBC__ WRAP_FSTATFS(64); +#endif #define WRAP_STATFS(suffix) \ int statfs ## suffix(const char *path, struct statfs ## suffix *buf) { \ @@ -1512,8 +1516,8 @@ int statfs ## suffix(const char *path, struct statfs ## suffix *buf) { \ } WRAP_STATFS(); +#ifdef __GLIBC__ WRAP_STATFS(64); - #endif int __open_2(const char *path, int flags);