# 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