diff options
3 files changed, 108 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch b/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch new file mode 100644 index 0000000000..0ef6fb4ec7 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/0001-include-cleanup-pidfd-inckudes.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 0a4035ff2e4fd5b5ae0cf8f8665696c2aff53b75 Mon Sep 17 00:00:00 2001 | ||
2 | From: Karel Zak <kzak@redhat.com> | ||
3 | Date: Tue, 10 Mar 2020 11:43:16 +0100 | ||
4 | Subject: [PATCH] include: cleanup pidfd inckudes | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/0a4035ff2e4fd5b5ae0cf8f8665696c2aff53b75] | ||
7 | |||
8 | Signed-off-by: Karel Zak <kzak@redhat.com> | ||
9 | Signed-off-by: Benjamin Fair <benjaminfair@google.com> | ||
10 | --- | ||
11 | include/pidfd-utils.h | 6 +++--- | ||
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
13 | |||
14 | diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h | ||
15 | index 0baedd2c9..4a6c3a604 100644 | ||
16 | --- a/include/pidfd-utils.h | ||
17 | +++ b/include/pidfd-utils.h | ||
18 | @@ -3,10 +3,10 @@ | ||
19 | |||
20 | #if defined(__linux__) | ||
21 | # include <sys/syscall.h> | ||
22 | -# if defined(SYS_pidfd_send_signal) | ||
23 | +# if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open) | ||
24 | # include <sys/types.h> | ||
25 | |||
26 | -# ifndef HAVE_PIDFD_OPEN | ||
27 | +# ifndef HAVE_PIDFD_SEND_SIGNAL | ||
28 | static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, | ||
29 | unsigned int flags) | ||
30 | { | ||
31 | @@ -14,7 +14,7 @@ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, | ||
32 | } | ||
33 | # endif | ||
34 | |||
35 | -# ifndef HAVE_PIDFD_SEND_SIGNAL | ||
36 | +# ifndef HAVE_PIDFD_OPEN | ||
37 | static inline int pidfd_open(pid_t pid, unsigned int flags) | ||
38 | { | ||
39 | return syscall(SYS_pidfd_open, pid, flags); | ||
40 | -- | ||
41 | 2.26.1.301.g55bc3eb7cb9-goog | ||
42 | |||
diff --git a/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch b/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch new file mode 100644 index 0000000000..e43e12873f --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 3cfde0370d3a8949df0c5bcf447cec6692910ed2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sami Kerola <kerolasa@iki.fi> | ||
3 | Date: Sat, 15 Feb 2020 21:12:50 +0000 | ||
4 | Subject: [PATCH] kill: include sys/types.h before checking | ||
5 | SYS_pidfd_send_signal | ||
6 | |||
7 | Including sys/types.h must happen before SYS_pidfd_send_signal is checked, | ||
8 | because that header defines variable in normal conditions. When sys/types.h | ||
9 | does not have SYS_pidfd_send_signal then fallback is defined in config.h | ||
10 | that is included by default, and has therefore worked fine before and after | ||
11 | this change. | ||
12 | |||
13 | Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/3cfde0370d3a8949df0c5bcf447cec6692910ed2] | ||
14 | |||
15 | Signed-off-by: Sami Kerola <kerolasa@iki.fi> | ||
16 | Signed-off-by: Benjamin Fair <benjaminfair@google.com> | ||
17 | --- | ||
18 | include/pidfd-utils.h | 18 ++++++++++-------- | ||
19 | 1 file changed, 10 insertions(+), 8 deletions(-) | ||
20 | |||
21 | diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h | ||
22 | index 593346576..0baedd2c9 100644 | ||
23 | --- a/include/pidfd-utils.h | ||
24 | +++ b/include/pidfd-utils.h | ||
25 | @@ -1,26 +1,28 @@ | ||
26 | #ifndef UTIL_LINUX_PIDFD_UTILS | ||
27 | #define UTIL_LINUX_PIDFD_UTILS | ||
28 | |||
29 | -#if defined(__linux__) && defined(SYS_pidfd_send_signal) | ||
30 | -# include <sys/types.h> | ||
31 | +#if defined(__linux__) | ||
32 | # include <sys/syscall.h> | ||
33 | +# if defined(SYS_pidfd_send_signal) | ||
34 | +# include <sys/types.h> | ||
35 | |||
36 | -# ifndef HAVE_PIDFD_OPEN | ||
37 | +# ifndef HAVE_PIDFD_OPEN | ||
38 | static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, | ||
39 | unsigned int flags) | ||
40 | { | ||
41 | return syscall(SYS_pidfd_send_signal, pidfd, sig, info, flags); | ||
42 | } | ||
43 | -# endif | ||
44 | +# endif | ||
45 | |||
46 | -# ifndef HAVE_PIDFD_SEND_SIGNAL | ||
47 | +# ifndef HAVE_PIDFD_SEND_SIGNAL | ||
48 | static inline int pidfd_open(pid_t pid, unsigned int flags) | ||
49 | { | ||
50 | return syscall(SYS_pidfd_open, pid, flags); | ||
51 | } | ||
52 | -# endif | ||
53 | +# endif | ||
54 | |||
55 | -# define UL_HAVE_PIDFD 1 | ||
56 | +# define UL_HAVE_PIDFD 1 | ||
57 | |||
58 | -#endif /* __linux__ && SYS_pidfd_send_signal */ | ||
59 | +# endif /* SYS_pidfd_send_signal */ | ||
60 | +#endif /* __linux__ */ | ||
61 | #endif /* UTIL_LINUX_PIDFD_UTILS */ | ||
62 | -- | ||
63 | 2.26.1.301.g55bc3eb7cb9-goog | ||
64 | |||
diff --git a/meta/recipes-core/util-linux/util-linux_2.35.1.bb b/meta/recipes-core/util-linux/util-linux_2.35.1.bb index 51964c9124..516b783887 100644 --- a/meta/recipes-core/util-linux/util-linux_2.35.1.bb +++ b/meta/recipes-core/util-linux/util-linux_2.35.1.bb | |||
@@ -9,6 +9,8 @@ SRC_URI += "file://configure-sbindir.patch \ | |||
9 | file://avoid_parallel_tests.patch \ | 9 | file://avoid_parallel_tests.patch \ |
10 | file://0001-hwclock-fix-for-glibc-2.31-settimeofday.patch \ | 10 | file://0001-hwclock-fix-for-glibc-2.31-settimeofday.patch \ |
11 | file://0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch \ | 11 | file://0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch \ |
12 | file://0001-kill-include-sys-types.h-before-checking-SYS_pidfd_s.patch \ | ||
13 | file://0001-include-cleanup-pidfd-inckudes.patch \ | ||
12 | " | 14 | " |
13 | SRC_URI[md5sum] = "7f64882f631225f0295ca05080cee1bf" | 15 | SRC_URI[md5sum] = "7f64882f631225f0295ca05080cee1bf" |
14 | SRC_URI[sha256sum] = "d9de3edd287366cd908e77677514b9387b22bc7b88f45b83e1922c3597f1d7f9" | 16 | SRC_URI[sha256sum] = "d9de3edd287366cd908e77677514b9387b22bc7b88f45b83e1922c3597f1d7f9" |