]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-90026: support XATTRs on Cygwin (GH-105075)
authorPhilippe Cerfon <41550983+philcerf@users.noreply.github.com>
Fri, 3 Nov 2023 09:37:46 +0000 (10:37 +0100)
committerGitHub <noreply@github.com>
Fri, 3 Nov 2023 09:37:46 +0000 (10:37 +0100)
Misc/NEWS.d/next/Library/2023-05-30-02-01-14.gh-issue-90026.FyCXw8.rst [new file with mode: 0644]
Modules/posixmodule.c

diff --git a/Misc/NEWS.d/next/Library/2023-05-30-02-01-14.gh-issue-90026.FyCXw8.rst b/Misc/NEWS.d/next/Library/2023-05-30-02-01-14.gh-issue-90026.FyCXw8.rst
new file mode 100644 (file)
index 0000000..3e32c98
--- /dev/null
@@ -0,0 +1 @@
+Define ``USE_XATTRS`` on Cygwin so that XATTR-related functions in the :mod:`os` module become available.
index 8611f8f73aff05bbabb44c82dd43f4fafd89232a..45debb9845e6c2b8a4bd83e7174983811ed54c50 100644 (file)
@@ -292,9 +292,15 @@ corresponding Unix manual entries for more information on calls.");
 #  undef HAVE_SCHED_SETAFFINITY
 #endif
 
-#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
-#  define USE_XATTRS
-#  include <linux/limits.h>  // Needed for XATTR_SIZE_MAX on musl libc.
+#if defined(HAVE_SYS_XATTR_H)
+#  if defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
+#    define USE_XATTRS
+#    include <linux/limits.h>  // Needed for XATTR_SIZE_MAX on musl libc.
+#  endif
+#  if defined(__CYGWIN__)
+#    define USE_XATTRS
+#    include <cygwin/limits.h>  // Needed for XATTR_SIZE_MAX and XATTR_LIST_MAX.
+#  endif
 #endif
 
 #ifdef USE_XATTRS