]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Use compile_c_snippet to check linux/pidfd.h availability
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 10 Aug 2022 17:24:44 +0000 (14:24 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 24 Aug 2022 13:01:29 +0000 (10:01 -0300)
Instead of tying to a specific kernel version.

Checked on x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)

sysdeps/unix/sysv/linux/tst-pidfd-consts.py

index 90cbb9be642f11d028fcef38c9673a3a57a8167e..d732173abda91332f6d586280cb776c3d047ba0d 100644 (file)
@@ -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 <linux/pidfd.h>',
+            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 <sys/pidfd.h>\n',
                 '#include <asm/fcntl.h>\n'