From: justdan6 <134341009+justdan6@users.noreply.github.com> Date: Fri, 28 Jul 2023 23:36:54 +0000 (-0600) Subject: [3.11] gh-106881: Check for linux/limits.h before including it (#107397) (#107415) X-Git-Tag: v3.11.5~117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4049c5d6f85627f117e9be6a1729a17fce899645;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-106881: Check for linux/limits.h before including it (#107397) (#107415) * [3.11] gh-106881: Check for linux/limits.h before including it (#107397) * Check for linux/limits.h before including it Co-authored-by: Erlend E. Aasland (cherry picked from commit 11c055f5ff1a353de6d2e77f2af24aaa782878ba) * Fix sphinx-lint error in NEWS entry --- diff --git a/Misc/NEWS.d/next/Build/2023-07-28-18-17-33.gh-issue-106881.U3Ezdq.rst b/Misc/NEWS.d/next/Build/2023-07-28-18-17-33.gh-issue-106881.U3Ezdq.rst new file mode 100644 index 000000000000..7febf99c48a7 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-07-28-18-17-33.gh-issue-106881.U3Ezdq.rst @@ -0,0 +1 @@ +Check for ``linux/limits.h`` before including it in ``Modules/posixmodule.c``. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c000a3203228..9d4228896d23 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -280,7 +280,7 @@ corresponding Unix manual entries for more information on calls."); # undef HAVE_SCHED_SETAFFINITY #endif -#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) +#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. #endif diff --git a/configure b/configure index d686e09d81c2..af4a5bbfdfa1 100755 --- a/configure +++ b/configure @@ -9191,7 +9191,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h # checks for header files for ac_header in \ alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h \ + ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/limits.h linux/memfd.h \ linux/random.h linux/soundcard.h \ linux/tipc.h linux/wait.h netdb.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ diff --git a/configure.ac b/configure.ac index 35026f7a2369..e1cbb7c7fbe9 100644 --- a/configure.ac +++ b/configure.ac @@ -2668,7 +2668,7 @@ AC_DEFINE(STDC_HEADERS, 1, [Define to 1 if you have the ANSI C header files.]) # checks for header files AC_CHECK_HEADERS([ \ alloca.h asm/types.h bluetooth.h conio.h crypt.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/memfd.h \ + ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/limits.h linux/memfd.h \ linux/random.h linux/soundcard.h \ linux/tipc.h linux/wait.h netdb.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ diff --git a/pyconfig.h.in b/pyconfig.h.in index 75f1d90e9bd3..0536047f573c 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -718,6 +718,9 @@ /* Define if compiling using Linux 4.1 or later. */ #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_LIMITS_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_MEMFD_H