Skip to content

Commit

Permalink
gh-106881: Check for linux/limits.h before including it (#107397)
Browse files Browse the repository at this point in the history
* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
  • Loading branch information
justdan6 and erlend-aasland committed Jul 28, 2023
1 parent cf63df8 commit 11c055f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check for `linux/limits.h` before including it in `Modules/posixmodule.c`.
2 changes: 1 addition & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,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 <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
#endif
Expand Down
6 changes: 6 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,7 @@ AC_DEFINE([STDC_HEADERS], [1],
# checks for header files
AC_CHECK_HEADERS([ \
alloca.h asm/types.h bluetooth.h conio.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/fs.h linux/memfd.h \
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 \
linux/random.h linux/soundcard.h \
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 \
sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@
/* Define to 1 if you have the <linux/fs.h> header file. */
#undef HAVE_LINUX_FS_H

/* Define to 1 if you have the <linux/limits.h> header file. */
#undef HAVE_LINUX_LIMITS_H

/* Define to 1 if you have the <linux/memfd.h> header file. */
#undef HAVE_LINUX_MEMFD_H

Expand Down

0 comments on commit 11c055f

Please sign in to comment.