From 76f30b3c4b980c6138e40ccb0ebacf0250682d1d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 8 Sep 2024 18:33:36 +0200 Subject: [PATCH] Use Linux functions on any OS based on GNU libc GNU libc (glibc) provides the prototypes for all the xattr functions. Hence, extend the Linux support to anything based on GNU libc. In case of failures, most likely the underlying xattr functions will need to be fixed, rather than pyxattr itself. --- xattr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xattr.c b/xattr.c index 9aabf0a..d6b1e5f 100644 --- a/xattr.c +++ b/xattr.c @@ -23,7 +23,7 @@ #define PY_SSIZE_T_CLEAN #include -#if defined(__APPLE__) || defined(__linux__) +#if defined(__APPLE__) || defined(__linux__) || defined(__GLIBC__) #include #endif #include @@ -224,7 +224,7 @@ static inline int _fremovexattr(int filedes, const char *name) { return fremovexattr(filedes, name, 0); } -#elif defined(__linux__) +#elif defined(__linux__) || defined(__GLIBC__) #define _listxattr(path, list, size) listxattr(path, list, size) #define _llistxattr(path, list, size) llistxattr(path, list, size) #define _flistxattr(fd, list, size) flistxattr(fd, list, size) -- 2.39.5