From 5ead4e85f6b58a099269b27def1cd03c4526ae19 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Oct 2019 16:29:42 +0100 Subject: [PATCH] missing: add rt_sigqueueinfo() syscall definition This is not a new system call at all (since kernel 2.2), however it's not exposed in glibc (a wrapper is exposed however in sigqueue(), but it substantially simplifies the system call). Since we want a nice fallback for sending signals on non-pidfd systems for pidfd_send_signal() let's wrap rt_sigqueueinfo() since it takes the same siginfo_t parameter. --- meson.build | 4 ++++ src/basic/missing_syscall.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/meson.build b/meson.build index edde42ea74a..3085af49fd7 100644 --- a/meson.build +++ b/meson.build @@ -525,6 +525,10 @@ foreach ident : [ #include #include #include '''], + ['rt_sigqueueinfo', '''#include + #include + #include + #include '''], ] have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index bea7be699d4..cbda3f7c605 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -562,3 +562,9 @@ static inline int pidfd_send_signal(int fd, int sig, siginfo_t *info, unsigned f #endif } #endif + +#if !HAVE_RT_SIGQUEUEINFO +static inline int rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *info) { + return syscall(__NR_rt_sigqueueinfo, tgid, sig, info); +} +#endif