Skip to content

Commit 95e0632

Browse files
committed
pythongh-90026: support XATTRs on Cygwin (python#90026)
1 parent cc2cf85 commit 95e0632

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
@@ -3743,7 +3743,7 @@ Linux extended attributes
37433743

37443744
.. versionadded:: 3.3
37453745

3746-
These functions are all available on Linux only.
3746+
These functions are all available on Linux and Cygwin only.
37473747

37483748
.. function:: getxattr(path, attribute, *, follow_symlinks=True)
37493749

‎Modules/posixmodule.c‎

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

288-
#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
289-
# define USE_XATTRS
290-
# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
288+
#if defined(HAVE_SYS_XATTR_H)
289+
# if defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
290+
# define USE_XATTRS
291+
# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
292+
# endif
293+
# if defined(__CYGWIN__)
294+
# define USE_XATTRS
295+
# include <cygwin/limits.h> // Needed for XATTR_SIZE_MAX and XATTR_LIST_MAX.
296+
# endif
291297
#endif
292298

293299
#ifdef USE_XATTRS

0 commit comments

Comments
 (0)