mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
missing_syscall: fix pidfd_{send_signal,open} numbers for alpha
Also order the syscalls by syscall number for easier comparisons with the
kernel headers.
Fixup for 5f152f43d0
.
This commit is contained in:
parent
0e68241138
commit
23654cee13
@ -527,39 +527,49 @@ static inline long missing_get_mempolicy(int *mode, unsigned long *nodemask,
|
||||
#define get_mempolicy missing_get_mempolicy
|
||||
#endif
|
||||
|
||||
#if !HAVE_PIDFD_OPEN
|
||||
/* may be (invalid) negative number due to libseccomp, see PR 13319 */
|
||||
# if ! (defined __NR_pidfd_open && __NR_pidfd_open >= 0)
|
||||
# if defined __NR_pidfd_open
|
||||
# undef __NR_pidfd_open
|
||||
# endif
|
||||
# define __NR_pidfd_open 434
|
||||
#endif
|
||||
static inline int pidfd_open(pid_t pid, unsigned flags) {
|
||||
#ifdef __NR_pidfd_open
|
||||
return syscall(__NR_pidfd_open, pid, flags);
|
||||
#else
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !HAVE_PIDFD_SEND_SIGNAL
|
||||
/* may be (invalid) negative number due to libseccomp, see PR 13319 */
|
||||
# if ! (defined __NR_pidfd_send_signal && __NR_pidfd_send_signal >= 0)
|
||||
# if defined __NR_pidfd_send_signal
|
||||
# undef __NR_pidfd_send_signal
|
||||
# endif
|
||||
# define __NR_pidfd_send_signal 424
|
||||
#endif
|
||||
/* should be always defined, see kernel 39036cd2727395c3369b1051005da74059a85317 */
|
||||
# if defined(__alpha__)
|
||||
# define __NR_pidfd_send_signal 534
|
||||
# else
|
||||
# define __NR_pidfd_send_signal 424
|
||||
# endif
|
||||
# endif
|
||||
static inline int pidfd_send_signal(int fd, int sig, siginfo_t *info, unsigned flags) {
|
||||
#ifdef __NR_pidfd_open
|
||||
# ifdef __NR_pidfd_open
|
||||
return syscall(__NR_pidfd_send_signal, fd, sig, info, flags);
|
||||
#else
|
||||
# else
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !HAVE_PIDFD_OPEN
|
||||
/* may be (invalid) negative number due to libseccomp, see PR 13319 */
|
||||
# if ! (defined __NR_pidfd_open && __NR_pidfd_open >= 0)
|
||||
# if defined __NR_pidfd_open
|
||||
# undef __NR_pidfd_open
|
||||
# endif
|
||||
/* should be always defined, see kernel 7615d9e1780e26e0178c93c55b73309a5dc093d7 */
|
||||
# if defined(__alpha__)
|
||||
# define __NR_pidfd_open 544
|
||||
# else
|
||||
# define __NR_pidfd_open 434
|
||||
# endif
|
||||
# endif
|
||||
static inline int pidfd_open(pid_t pid, unsigned flags) {
|
||||
# ifdef __NR_pidfd_open
|
||||
return syscall(__NR_pidfd_open, pid, flags);
|
||||
# else
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user