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-12 09:15:11 -0300
commit1542019b69b7ec7b2cd34357af035e406d153631 (patch)
tree5ac9764f66ccb72ebf55c75df24dac405de46e70 /sysdeps/unix
parent841afa116e32b3c7195475769c26bf46fd870d32 (diff)
downloadglibc-1542019b69b7ec7b2cd34357af035e406d153631.tar
glibc-1542019b69b7ec7b2cd34357af035e406d153631.tar.gz
glibc-1542019b69b7ec7b2cd34357af035e406d153631.tar.bz2
glibc-1542019b69b7ec7b2cd34357af035e406d153631.zip
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>
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/tst-pidfd-consts.py8
1 files 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 <linux/pidfd.h>',
+ 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 <sys/pidfd.h>\n',