diff options
author | Sam James <sam@gentoo.org> | 2023-02-14 07:21:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 07:21:58 (GMT) |
commit | 8be8101bca34b60481ec3d7ecaea4a3379fb7dbb (patch) | |
tree | ce3ca605afc7ee4c359f2cbc6b5ac9a15257b69f /Modules/posixmodule.c | |
parent | 928752ce4c23f47d3175dd47ecacf08d86a99c9d (diff) | |
download | cpython-8be8101bca34b60481ec3d7ecaea4a3379fb7dbb.zip cpython-8be8101bca34b60481ec3d7ecaea4a3379fb7dbb.tar.gz cpython-8be8101bca34b60481ec3d7ecaea4a3379fb7dbb.tar.bz2 |
gh-101857: Allow xattr detection on musl libc (#101858)
Previously, we checked exclusively for `__GLIBC__` (AND'd with some other
conditions). Checking for `__linux__` instead should be fine.
This fixes using e.g. `os.listxattr()` on systems using musl libc.
Bug: https://bugs.gentoo.org/894130
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index cba6cea..d9e9347 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -274,8 +274,9 @@ corresponding Unix manual entries for more information on calls."); # undef HAVE_SCHED_SETAFFINITY #endif -#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) +#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) # define USE_XATTRS +# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc. #endif #ifdef USE_XATTRS |