From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 64ADF3858C56; Fri, 12 Aug 2022 12:52:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64ADF3858C56 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] 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/master X-Git-Oldrev: 841afa116e32b3c7195475769c26bf46fd870d32 X-Git-Newrev: 1542019b69b7ec7b2cd34357af035e406d153631 Message-Id: <20220812125234.64ADF3858C56@sourceware.org> Date: Fri, 12 Aug 2022 12:52:34 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2022 12:52:34 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1542019b69b7ec7b2cd34357af035e406d153631 commit 1542019b69b7ec7b2cd34357af035e406d153631 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 Diff: --- sysdeps/unix/sysv/linux/tst-pidfd-consts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py index e207b55eef..d732173abd 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',