From: Adhemerval Zanella Date: Wed, 10 Aug 2022 17:24:44 +0000 (-0300) Subject: linux: Use compile_c_snippet to check linux/pidfd.h availability X-Git-Tag: upstream/2.37~429 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1542019b69b7ec7b2cd34357af035e406d153631;p=platform%2Fupstream%2Fglibc.git linux: Use compile_c_snippet to check linux/pidfd.h availability Instead of tying to a specific kernel version. Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer --- diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py index e207b55..d732173 100644 --- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py +++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py @@ -33,10 +33,12 @@ def main(): help='C compiler (including options) to use') args = parser.parse_args() - linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc) - # Linux started to provide pidfd.h with 5.10. - if linux_version_headers < (5, 10): + if glibcextract.compile_c_snippet( + '#include ', + args.cc).returncode != 0: sys.exit (77) + + linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc) linux_version_glibc = (5, 19) sys.exit(glibcextract.compare_macro_consts( '#include \n',