All linux targets these days have epoll_pwait system call
(while some miss epoll_wait, which is less generic). And
all linux targets definitely has one or another epoll_*wait*
system call - so whole code block dealing with this system
call should always be present.
Remove the now-unneeded ifdeff'ery.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
linux-user/syscall.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2060e561a2..d89c36382e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -13615,13 +13615,10 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
}
#endif
-#if defined(TARGET_NR_epoll_wait) || defined(TARGET_NR_epoll_pwait)
#if defined(TARGET_NR_epoll_wait)
case TARGET_NR_epoll_wait:
#endif
-#if defined(TARGET_NR_epoll_pwait)
case TARGET_NR_epoll_pwait:
-#endif
{
struct target_epoll_event *target_ep;
struct epoll_event *ep;
@@ -13646,7 +13643,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
}
switch (num) {
-#if defined(TARGET_NR_epoll_pwait)
case TARGET_NR_epoll_pwait:
{
sigset_t *set = NULL;
@@ -13666,7 +13662,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
}
break;
}
-#endif
#if defined(TARGET_NR_epoll_wait)
case TARGET_NR_epoll_wait:
ret = get_errno(safe_epoll_pwait(epfd, ep, maxevents, timeout,
@@ -13690,8 +13685,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
g_free(ep);
return ret;
}
-#endif
-#endif
+#endif /* CONFIG_EPOLL */
#ifdef TARGET_NR_prlimit64
case TARGET_NR_prlimit64:
{
--
2.47.3
On 1/8/26 9:43 AM, Michael Tokarev wrote:
> All linux targets these days have epoll_pwait system call
> (while some miss epoll_wait, which is less generic). And
> all linux targets definitely has one or another epoll_*wait*
> system call - so whole code block dealing with this system
> call should always be present.
>
> Remove the now-unneeded ifdeff'ery.
>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> linux-user/syscall.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
Makes sense:
epoll_wait()
Linux 2.6, glibc 2.3.2.
epoll_pwait()
Linux 2.6.19, glibc 2.6.
Which has made this available for 9 years.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
On 1/8/26 22:52, Pierrick Bouvier wrote: > On 1/8/26 9:43 AM, Michael Tokarev wrote: >> All linux targets these days have epoll_pwait system call >> (while some miss epoll_wait, which is less generic). And >> all linux targets definitely has one or another epoll_*wait* >> system call - so whole code block dealing with this system >> call should always be present. >> >> Remove the now-unneeded ifdeff'ery. >> >> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> >> --- >> linux-user/syscall.c | 8 +------- >> 1 file changed, 1 insertion(+), 7 deletions(-) >> > > Makes sense: > > epoll_wait() > Linux 2.6, glibc 2.3.2. > > epoll_pwait() > Linux 2.6.19, glibc 2.6. > > Which has made this available for 9 years. This is not it, Pierrick :) qemu ships its own copy of linux headers with all these __NR_foo definitions. We don't have to deal with local linux headers, we know exactly and precisely what we ship and which targets defines which syscalls. Once all arches has __NR_epoll_wait *in our copy of linux-headers*, we're all set. No matter if it was 9 years ago or yesterday. TARGET_NR_foo is what *we* know, - and it might be much more fresh than the host kernel we're running on. Thanks, /mjt
© 2016 - 2026 Red Hat, Inc.