summaryrefslogtreecommitdiff
path: root/sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-02-12 09:56:54 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-02-12 09:56:54 +0000
commitebc282ef4dfa408accac685565b8ee5f6faec119 (patch)
treec0a4f713228cda0ab17eed46f0bb7ca8cb8be2f6 /sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch
parent6c8694a707151d59555b0e4e48235f085ce166c3 (diff)
gentoo auto-resync : 12:02:2023 - 09:56:54
Diffstat (limited to 'sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch')
-rw-r--r--sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch b/sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch
new file mode 100644
index 000000000000..0a1975fff685
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.38.1-check-for-sys-pidfd.h.patch
@@ -0,0 +1,52 @@
+https://github.com/util-linux/util-linux/pull/1769
+https://bugs.gentoo.org/893966
+
+From 84732a8849a08d42a9a95dcbee9005116be78eb8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 7 Aug 2022 14:39:19 -0700
+Subject: [PATCH] check for sys/pidfd.h
+
+This header in newer glibc defines the signatures of functions
+pidfd_send_signal() and pidfd_open() and when these functions are
+defined by libc then we need to include the relevant header to get
+the definitions. Clang 15+ has started to error out when function
+signatures are missing.
+
+Fixes errors like
+misc-utils/kill.c:402:6: error: call to undeclared function 'pidfd_send_signal'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+ if (pidfd_send_signal(pfd, ctl->numsig, &info, 0) < 0)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 1 +
+ include/pidfd-utils.h | 4 +++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 51deeecd4e..daa8f0dca4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -342,6 +342,7 @@ AC_CHECK_HEADERS([ \
+ sys/mkdev.h \
+ sys/mount.h \
+ sys/param.h \
++ sys/pidfd.h \
+ sys/prctl.h \
+ sys/resource.h \
+ sys/sendfile.h \
+diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h
+index eddede9767..d9e33cbc57 100644
+--- a/include/pidfd-utils.h
++++ b/include/pidfd-utils.h
+@@ -4,8 +4,10 @@
+ #ifdef HAVE_SYS_SYSCALL_H
+ # include <sys/syscall.h>
+ # if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open)
++# ifdef HAVE_SYS_PIDFD_H
++# include <sys/pidfd.h>
++# endif
+ # include <sys/types.h>
+-
+ # ifndef HAVE_PIDFD_SEND_SIGNAL
+ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
+ unsigned int flags)