Skip to content

Commit a6b7599

Browse files
committed
pythongh-90026: support XATTRs on Cygwin (python#90026)
1 parent d593074 commit a6b7599

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
@@ -286,9 +286,15 @@ corresponding Unix manual entries for more information on calls.");
286286
# undef HAVE_SCHED_SETAFFINITY
287287
#endif
288288

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

294300
#ifdef USE_XATTRS

0 commit comments

Comments
 (0)