aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-08-10 14:24:44 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-08-24 10:01:29 -0300
commit1cc5513114e76083669cba1b11252aad35525e69 (patch)
tree04522c5be0f8e6873c886e789c9377c0da018c6e /sysdeps/unix
parent0062e7dd1c3674ece2daca53a898badd28b60421 (diff)
downloadglibc-1cc5513114e76083669cba1b11252aad35525e69.zip
glibc-1cc5513114e76083669cba1b11252aad35525e69.tar.gz
glibc-1cc5513114e76083669cba1b11252aad35525e69.tar.bz2
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 <fweimer@redhat.com> (cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/tst-pidfd-consts.py10
1 files 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 90cbb9b..d732173 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 <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'