10000 gh-106881: Check for linux/limits.h before including it (#107397) · python/cpython@11c055f · GitHub
[go: up one dir, main page]

Skip to content

Commit 11c055f

Browse files
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 <erlend.aasland@protonmail.com>
1 parent cf63df8 commit 11c055f

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Check for `linux/limits.h` before including it in `Modules/posixmodule.c`.

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ corresponding Unix manual entries for more information on calls.");
285285
# undef HAVE_SCHED_SETAFFINITY
286286
#endif
287287

288-
#if defined(HAVE_SYS_XATTR_H) && defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
288+
#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
289289
# define USE_XATTRS
290290
# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
291291
#endif

configure

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2848,7 +2848,7 @@ AC_DEFINE([STDC_HEADERS], [1],
28482848
# checks for header files
28492849
AC_CHECK_HEADERS([ \
28502850
alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
2851-
ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/memfd.h \
2851+
ieeefp.h io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \
28522852
linux/random.h linux/soundcard.h \
28532853
linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
28542854
sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,9 @@
721721
/* Define to 1 if you have the <linux/fs.h> header file. */
722722
#undef HAVE_LINUX_FS_H
723723

724+
/* Define to 1 if you have the <linux/limits.h> header file. */
725+
#undef HAVE_LINUX_LIMITS_H
726+
724727
/* Define to 1 if you have the <linux/memfd.h> header file. */
725728
#undef HAVE_LINUX_MEMFD_H
726729

0 commit comments

Comments
 (0)
0