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>
This commit is contained in:
justdan6 2023-07-28 16:08:43 -06:00 committed by GitHub
parent cf63df88d3
commit 11c055f5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1 @@
Check for `linux/limits.h` before including it in `Modules/posixmodule.c`.

View File

@ -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

6
configure generated vendored
View File

@ -10549,6 +10549,12 @@ if test "x$ac_cv_header_linux_fs_h" = xyes
then :
printf "%s\n" "#define HAVE_LINUX_FS_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "linux/limits.h" "ac_cv_header_linux_limits_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_limits_h" = xyes
then :
printf "%s\n" "#define HAVE_LINUX_LIMITS_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "linux/memfd.h" "ac_cv_header_linux_memfd_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_memfd_h" = xyes

View File

@ -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 \

View File

@ -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