From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id E3B163851C19; Wed, 24 Aug 2022 13:06:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3B163851C19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661346364; bh=Wa6IeARjc7ZGcSZAWKtjgW19gQuURCd35POEKRu66mE=; h=From:To:Subject:Date:From; b=MensNgKNNt5oJI9b3OrxV7gNR/dilqvBN/WxNG55BazYcdie15qDLAGXaha/3b9tb 13w8nW1vnxHMBYnpPebaAf4WRHU4Hwj+lRo096FqVKVVJUkYGe8b4yeIgyvJYRKaqq 0mIT3nEocyNOWtJSiSyqkLkzpElRthTUk8AK9hFo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/release/2.36/master] linux: Use compile_c_snippet to check linux/pidfd.h availability X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/release/2.36/master X-Git-Oldrev: 0062e7dd1c3674ece2daca53a898badd28b60421 X-Git-Newrev: 1cc5513114e76083669cba1b11252aad35525e69 Message-Id: <20220824130604.E3B163851C19@sourceware.org> Date: Wed, 24 Aug 2022 13:06:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1cc5513114e76083669cba1b11252aad35525e69 commit 1cc5513114e76083669cba1b11252aad35525e69 Author: Adhemerval Zanella Date: Wed Aug 10 14:24:44 2022 -0300 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 (cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631) Diff: --- sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py index 90cbb9be64..d732173abd 100644 --- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py +++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py @@ -33,11 +33,13 @@ 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_glibc = (5, 18) + + linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc) + linux_version_glibc = (5, 19) sys.exit(glibcextract.compare_macro_consts( '#include \n', '#include \n'