1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

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.
This commit is contained in:
Lennart Poettering 2019-10-30 16:29:42 +01:00
parent 5f152f43d0
commit 5ead4e85f6
2 changed files with 10 additions and 0 deletions

View File

@ -525,6 +525,10 @@ foreach ident : [
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>'''],
['rt_sigqueueinfo', '''#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>'''],
]
have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')

View File

@ -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