libredirect: fix build on musl libc

musl doesn't yet provide a wrapper for the statx syscall, so don't
bother wrapping it here unless it's actually available.
This commit is contained in:
Noah Fontes 2023-02-05 17:33:08 -08:00
parent f876e1f1e9
commit 07c6e6b2b8
No known key found for this signature in database
GPG Key ID: 85B8C0A0B15FF53F
2 changed files with 3 additions and 3 deletions

View File

@ -201,7 +201,7 @@ WRAPPER(int, __xstat64)(int ver, const char * path, struct stat64 * st)
WRAPPER_DEF(__xstat64)
#endif
#ifdef __linux__
#if defined(__linux__) && defined(STATX_TYPE)
WRAPPER(int, statx)(int dirfd, const char * restrict pathname, int flags,
unsigned int mask, struct statx * restrict statxbuf)
{

View File

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
#ifndef __APPLE__
struct stat64 testsb64;
#endif
#ifdef __linux__
#if defined(__linux__) && defined(STATX_TYPE)
struct statx testsbx;
#endif
char buf[PATH_MAX];
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
#ifndef __APPLE__
assert(fstatat64(123, TESTPATH, &testsb64, 0) != -1);
#endif
#ifdef __linux__
#if defined(__linux__) && defined(STATX_TYPE)
assert(statx(123, TESTPATH, 0, STATX_ALL, &testsbx) != -1);
#endif