@samitouri / QOSamiQemu / commits / ecec2bd8f3

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>

Michael Tokarev committed Jan 10, 2026 at 00:14 UTC ecec2bd8f36e61d5513564e5cdfdf05dd92948cb
2 files changed +2 -11
linux-user/syscall.c
+2 -8
@@ -73,9 +73,7 @@
73 #ifdef CONFIG_EVENTFD
74 #include <sys/eventfd.h>
75 #endif
76 -#ifdef CONFIG_EPOLL
76 #include <sys/epoll.h>
78 -#endif
77 #ifdef CONFIG_ATTR
78 #include "qemu/xattr.h"
79 #endif
@@ -13732,16 +13730,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
13730 case TARGET_NR_signalfd:
13731 return do_signalfd4(arg1, arg2, 0);
13732 #endif
13735 -#if defined(CONFIG_EPOLL)
13733 +
13734 #if defined(TARGET_NR_epoll_create)
13735 case TARGET_NR_epoll_create:
13736 return get_errno(epoll_create(arg1));
13737 #endif
13740 -#if defined(TARGET_NR_epoll_create1) && defined(CONFIG_EPOLL_CREATE1)
13738 case TARGET_NR_epoll_create1:
13739 return get_errno(epoll_create1(target_to_host_bitmask(arg1, fcntl_flags_tbl)));
13743 -#endif
13744 -#if defined(TARGET_NR_epoll_ctl)
13740 case TARGET_NR_epoll_ctl:
13741 {
13742 struct epoll_event ep;
@@ -13770,7 +13765,6 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
13765 }
13766 return get_errno(epoll_ctl(arg1, arg2, arg3, epp));
13767 }
13773 -#endif
13768
13769 #if defined(TARGET_NR_epoll_wait)
13770 case TARGET_NR_epoll_wait:
@@ -13856,7 +13850,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
13850 g_free(ep);
13851 return ret;
13852 }
13859 -#endif /* CONFIG_EPOLL */
13853 +
13854 #ifdef TARGET_NR_prlimit64
13855 case TARGET_NR_prlimit64:
13856 {
linux-user/syscall_defs.h
-3
@@ -2595,7 +2595,6 @@ struct target_drm_i915_getparam {
2595 #define FUTEX_CLOCK_REALTIME 256
2596 #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
2597
2598 -#ifdef CONFIG_EPOLL
2598 #if defined(TARGET_X86_64)
2599 #define TARGET_EPOLL_PACKED QEMU_PACKED
2600 #else
@@ -2616,8 +2615,6 @@ struct target_epoll_event {
2615
2616 #define TARGET_EP_MAX_EVENTS (INT_MAX / sizeof(struct target_epoll_event))
2617
2619 -#endif
2620 -
2618 struct target_ucred {
2619 abi_uint pid;
2620 abi_uint uid;