]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pidfd: properly detect if libc offers pidfd syscalls and make use of them then
authorLennart Poettering <lennart@poettering.net>
Wed, 8 May 2024 10:27:38 +0000 (12:27 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 8 May 2024 13:36:40 +0000 (15:36 +0200)
We never updated the meson checks when glibc finally learned about these
syscalls, address that.

meson.build
src/basic/pidref.c
src/libsystemd/sd-event/sd-event.c
src/libsystemd/sd-event/test-event.c
src/libsystemd/sd-login/test-login.c
src/login/pam_systemd.c
src/test/test-aux-scope.c

index 6ea9fce85ad9ac5581711711dce1c070534f475c..0d68f146fd4f308ea5d59767746b5a1673c72b07 100644 (file)
@@ -624,11 +624,13 @@ foreach ident : [
         ['pidfd_send_signal', '''#include <stdlib.h>
                                  #include <unistd.h>
                                  #include <signal.h>
-                                 #include <sys/wait.h>'''],
+                                 #include <sys/wait.h>
+                                 #include <sys/pidfd.h>'''],
         ['pidfd_open',        '''#include <stdlib.h>
                                  #include <unistd.h>
                                  #include <signal.h>
-                                 #include <sys/wait.h>'''],
+                                 #include <sys/wait.h>
+                                 #include <sys/pidfd.h>'''],
         ['rt_sigqueueinfo',   '''#include <stdlib.h>
                                  #include <unistd.h>
                                  #include <signal.h>
index 875fa11bea878020838920424865da8cc0fb89c4..ae04dd72a4b532e9291c9417c79f69b997165af9 100644 (file)
@@ -1,5 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#if HAVE_PIDFD_OPEN
+#include <sys/pidfd.h>
+#endif
+
 #include "errno-util.h"
 #include "fd-util.h"
 #include "missing_syscall.h"
index bd5bd81ac4314bb2dcf2a10bffe497ff5d71625d..a1305ef01493e76d63314e9abe8166757f83c1f4 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <sys/epoll.h>
+#if HAVE_PIDFD_OPEN
+#include <sys/pidfd.h>
+#endif
 #include <sys/timerfd.h>
 #include <sys/wait.h>
 
index c617935992245d5426fc97ccafe35ffa7b3a9259..57dee392d74fd178f7910f6945b2278bf097eb9a 100644 (file)
@@ -1,5 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#if HAVE_PIDFD_OPEN
+#include <sys/pidfd.h>
+#endif
 #include <sys/wait.h>
 #include <unistd.h>
 
index c83c953dd92f3d7ef2e6e4502195cd156d9d44bc..66e427411e4e55cbc818d580462096ced068daa5 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <poll.h>
+#if HAVE_PIDFD_OPEN
+#include <sys/pidfd.h>
+#endif
 
 #include "sd-login.h"
 
index e01f35b65e445457895dc90622900f8249c24b64..a711c89b12b673ae2913e675f62b9c287d6876f5 100644 (file)
@@ -10,6 +10,9 @@
 #include <security/pam_modules.h>
 #include <security/pam_modutil.h>
 #include <sys/file.h>
+#if HAVE_PIDFD_OPEN
+#include <sys/pidfd.h>
+#endif
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 #include <sys/types.h>
index c6a1d292730935f57c496b7e6fee4382247c97f9..0170314035c2d9728e015530dbe48ff547e7686d 100644 (file)
@@ -3,6 +3,9 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#if HAVE_PIDFD_OPEN
+#include <sys/pidfd.h>
+#endif
 #include <sys/wait.h>
 
 #include "sd-event.h"