From 7810b6981ac663b77bc9ee9dc4b1960ec6845ea7 Mon Sep 17 00:00:00 2001 From: Philippe Cerfon <41550983+philcerf@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:37:46 +0100 Subject: gh-90026: support XATTRs on Cygwin (GH-105075) --- .../Library/2023-05-30-02-01-14.gh-issue-90026.FyCXw8.rst | 1 + Modules/posixmodule.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2023-05-30-02-01-14.gh-issue-90026.FyCXw8.rst 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 index 0000000..3e32c98 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-05-30-02-01-14.gh-issue-90026.FyCXw8.rst @@ -0,0 +1 @@ +Define ``USE_XATTRS`` on Cygwin so that XATTR-related functions in the :mod:`os` module become available. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8611f8f..45debb9 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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 // 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 // Needed for XATTR_SIZE_MAX on musl libc. +# endif +# if defined(__CYGWIN__) +# define USE_XATTRS +# include // Needed for XATTR_SIZE_MAX and XATTR_LIST_MAX. +# endif #endif #ifdef USE_XATTRS -- cgit v0.12