[LTP] [PATCH 1/2] Add configure check for sys/pidfd.h

Khem Raj raj.khem@gmail.com
Tue Aug 16 07:15:38 CEST 2022


Use it to include newly added sys/pidfd.h in glibc 2.36+

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 configure.ac         | 1 +
 include/lapi/pidfd.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index 81cba98c2..a0123f166 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,7 @@ AC_CHECK_HEADERS_ONCE([ \
     sys/epoll.h \
     sys/fanotify.h \
     sys/inotify.h \
+    sys/pidfd.h \
     sys/prctl.h \
     sys/shm.h \
     sys/timerfd.h \
diff --git a/include/lapi/pidfd.h b/include/lapi/pidfd.h
index 244d3acaf..d29a2b274 100644
--- a/include/lapi/pidfd.h
+++ b/include/lapi/pidfd.h
@@ -15,6 +15,10 @@
 #define PIDFD_NONBLOCK O_NONBLOCK
 #endif
 
+#ifdef HAVE_SYS_PIDFD_H
+#include <sys/pidfd.h>
+#endif
+
 static inline void pidfd_send_signal_supported(void)
 {
 	/* allow the tests to fail early */
-- 
2.37.2



More information about the ltp mailing list