Skip to content

Commit ccb6483

Browse files
thesamesamgpshead
authored andcommitted
pythongh-101857: Allow xattr detection on musl libc (python#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 <[email protected]>
1 parent 142ae54 commit ccb6483

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix xattr support detection on Linux systems by widening the check to linux, not just glibc. This fixes support for musl.

Modules/posixmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ corresponding Unix manual entries for more information on calls.");
134134

135135
#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
136136
#define USE_XATTRS
137+
#include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
137138
#endif
138139

139140
#ifdef USE_XATTRS

0 commit comments

Comments
 (0)