summaryrefslogtreecommitdiff
path: root/src/basic/missing_syscall.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-11-22 15:38:52 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2022-11-23 00:54:23 +0100
commit0c14c45e5c00bbaed81566ace8f0d0c70cfe6392 (patch)
treeff5e3cdb85325f6927bde512838f15eabc1e2709 /src/basic/missing_syscall.h
parentc9bb7438dba715deb8c068cbd7d6dc0e09e44ca9 (diff)
downloadsystemd-0c14c45e5c00bbaed81566ace8f0d0c70cfe6392.tar.gz
sd-event: reenable epoll_pwait2()
This reenables epoll_pwait2() use, i.e. undoes the effect of 39f756d3ae4765b8bf017567a12b8a4b358eaaf5. Instead of just reverting that, this PR will change things so that we strictly rely on glibc's new epoll_pwait2() wrapper (which was added earlier this year), and drop our own manual fallback syscall wrapper. That should nicely side-step any issues with correct syscall wrapping definitions (which on some arch seem not to be easy, given the sigset_t size final argument), by making this a glibc problem, not ours. Given that the only benefit this delivers are time-outs more granular than msec, it shouldn't really matter that we'll miss out on support for this on systems with older glibcs.
Diffstat (limited to 'src/basic/missing_syscall.h')
-rw-r--r--src/basic/missing_syscall.h38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
index 6ad89da541..98cd037962 100644
--- a/src/basic/missing_syscall.h
+++ b/src/basic/missing_syscall.h
@@ -426,44 +426,6 @@ static inline int missing_close_range(int first_fd, int end_fd, unsigned flags)
/* ======================================================================= */
-#if !HAVE_EPOLL_PWAIT2
-
-/* Defined to be equivalent to the kernel's _NSIG_WORDS, i.e. the size of the array of longs that is
- * encapsulated by sigset_t. */
-#define KERNEL_NSIG_WORDS (64 / (sizeof(long) * 8))
-#define KERNEL_NSIG_BYTES (KERNEL_NSIG_WORDS * sizeof(long))
-
-struct epoll_event;
-
-static inline int missing_epoll_pwait2(
- int fd,
- struct epoll_event *events,
- int maxevents,
- const struct timespec *timeout,
- const sigset_t *sigset) {
-
-# if defined(__NR_epoll_pwait2) && HAVE_LINUX_TIME_TYPES_H
- if (timeout) {
- /* Convert from userspace timespec to kernel timespec */
- struct __kernel_timespec ts = {
- .tv_sec = timeout->tv_sec,
- .tv_nsec = timeout->tv_nsec,
- };
-
- return syscall(__NR_epoll_pwait2, fd, events, maxevents, &ts, sigset, sigset ? KERNEL_NSIG_BYTES : 0);
- } else
- return syscall(__NR_epoll_pwait2, fd, events, maxevents, NULL, sigset, sigset ? KERNEL_NSIG_BYTES : 0);
-# else
- errno = ENOSYS;
- return -1;
-# endif
-}
-
-# define epoll_pwait2 missing_epoll_pwait2
-#endif
-
-/* ======================================================================= */
-
#if !HAVE_MOUNT_SETATTR
#if !HAVE_STRUCT_MOUNT_ATTR