Skip to content

Commit 3b1bf34

Browse files
committed
pythongh-90026: support XATTRs on Cygwin (python#90026)
1 parent 6c23635 commit 3b1bf34

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎Doc/library/os.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3997,7 +3997,7 @@ Linux extended attributes
39973997

39983998
.. versionadded:: 3.3
39993999

4000-
These functions are all available on Linux only.
4000+
These functions are all available on Linux and Cygwin only.
40014001

40024002
.. function:: getxattr(path, attribute, *, follow_symlinks=True)
40034003

‎Modules/posixmodule.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,15 @@ corresponding Unix manual entries for more information on calls.");
292292
# undef HAVE_SCHED_SETAFFINITY
293293
#endif
294294

295-
#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
296-
# define USE_XATTRS
297-
# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
295+
#if defined(HAVE_SYS_XATTR_H)
296+
# if defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
297+
# define USE_XATTRS
298+
# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
299+
# endif
300+
# if defined(__CYGWIN__)
301+
# define USE_XATTRS
302+
# include <cygwin/limits.h> // Needed for XATTR_SIZE_MAX and XATTR_LIST_MAX.
303+
# endif
298304
#endif
299305

300306
#ifdef USE_XATTRS

0 commit comments

Comments
 (0)