Commit ecec2bd8f3 for qemu.org
commit ecec2bd8f36e61d5513564e5cdfdf05dd92948cb
Author: Michael Tokarev <mjt@tls.msk.ru>
Date: Sat Jan 10 00:14:57 2026 +0300
linux-user: assume epoll is always present
epoll is in linux since 2.6 (glibc 2.3.2).
epoll_init1 has been added in 2.6.27 (glibc 2.9).
There's no need to check for its presence, including all other
epoll-related syscalls.
Modern architectures don't have epoll_create(), only
epoll_create1(), so keep conditional around the former.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f28e7e93f..7832a1aba5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -73,9 +73,7 @@
#ifdef CONFIG_EVENTFD
#include <sys/eventfd.h>
#endif
-#ifdef CONFIG_EPOLL
#include <sys/epoll.h>
-#endif
#ifdef CONFIG_ATTR
#include "qemu/xattr.h"
#endif
@@ -13732,16 +13730,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
case TARGET_NR_signalfd:
return do_signalfd4(arg1, arg2, 0);
#endif
-#if defined(CONFIG_EPOLL)
+
#if defined(TARGET_NR_epoll_create)
case TARGET_NR_epoll_create:
return get_errno(epoll_create(arg1));
#endif
-#if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
case TARGET_NR_epoll_create1:
return get_errno(epoll_create1(target_to_host_bitmask(arg1, fcntl_flags_tbl)));
-#endif
-#if defined(TARGET_NR_epoll_ctl)
case TARGET_NR_epoll_ctl:
{
struct epoll_event ep;
@@ -13770,7 +13765,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
}
return get_errno(epoll_ctl(arg1, arg2, arg3, epp));
}
-#endif
#if defined(TARGET_NR_epoll_wait)
case TARGET_NR_epoll_wait:
@@ -13856,7 +13850,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
g_free(ep);
return ret;
}
-#endif /* CONFIG_EPOLL */
+
#ifdef TARGET_NR_prlimit64
case TARGET_NR_prlimit64:
{
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 20d862fd8b..aac8b0c574 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2595,7 +2595,6 @@ struct target_drm_i915_getparam {
#define FUTEX_CLOCK_REALTIME 256
#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
-#ifdef CONFIG_EPOLL
#if defined(TARGET_X86_64)
#define TARGET_EPOLL_PACKED QEMU_PACKED
#else
@@ -2616,8 +2615,6 @@ struct target_epoll_event {
#define TARGET_EP_MAX_EVENTS (INT_MAX / sizeof(struct target_epoll_event))
-#endif
-
struct target_ucred {
abi_uint pid;
abi_uint uid;