ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Yu Watanabe a602cc
From 2ad2a50a832140edfb49a95384e35bcf7a034acf Mon Sep 17 00:00:00 2001
Yu Watanabe f78024
From: Lennart Poettering <lennart@poettering.net>
Yu Watanabe f78024
Date: Thu, 11 Mar 2021 21:49:44 +0100
Yu Watanabe f78024
Subject: [PATCH] syscall: disable epoll_pwait2() for now on 32bit
Yu Watanabe f78024
Yu Watanabe f78024
Alternative to #18973.
Yu Watanabe f78024
---
Yu Watanabe f78024
 src/basic/missing_syscall.h | 8 ++++++++
Yu Watanabe f78024
 1 file changed, 8 insertions(+)
Yu Watanabe f78024
Yu Watanabe f78024
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
Yu Watanabe a602cc
index 13843248045..8bbe4d28847 100644
Yu Watanabe f78024
--- a/src/basic/missing_syscall.h
Yu Watanabe f78024
+++ b/src/basic/missing_syscall.h
Yu Watanabe f78024
@@ -407,6 +407,13 @@ static inline int missing_epoll_pwait2(
Yu Watanabe f78024
                 const sigset_t *sigset) {
Yu Watanabe f78024
 
Yu Watanabe f78024
 #  if defined(__NR_epoll_pwait2) && HAVE_LINUX_TIME_TYPES_H
Yu Watanabe f78024
+#    if __SIZEOF_LONG__ == 4
Yu Watanabe a602cc
+        /* Someone with an interest in 32bit systems, please have a look at this, and figure out why
Yu Watanabe a602cc
+         * this hangs on 32bit systems. My educated guess: might be because of issues with the
Yu Watanabe a602cc
+         * __kernel_timespec translation or because of incorrectly sized sigset_t array. */
Yu Watanabe f78024
+        errno = ENOSYS;
Yu Watanabe f78024
+        return -1;
Yu Watanabe f78024
+#    else
Yu Watanabe f78024
         if (timeout) {
Yu Watanabe f78024
                 /* Convert from userspace timespec to kernel timespec */
Yu Watanabe f78024
                 struct __kernel_timespec ts = {
Yu Watanabe f78024
@@ -417,6 +424,7 @@ static inline int missing_epoll_pwait2(
Yu Watanabe f78024
                 return syscall(__NR_epoll_pwait2, fd, events, maxevents, &ts, sigset, sigset ? KERNEL_NSIG_BYTES : 0);
Yu Watanabe f78024
         } else
Yu Watanabe f78024
                 return syscall(__NR_epoll_pwait2, fd, events, maxevents, NULL, sigset, sigset ? KERNEL_NSIG_BYTES : 0);
Yu Watanabe f78024
+#    endif
Yu Watanabe f78024
 #  else
Yu Watanabe f78024
         errno = ENOSYS;
Yu Watanabe f78024
         return -1;