From: Michael Tokarev Date: Fri, 9 Jan 2026 21:14:57 +0000 (+0300) Subject: linux-user: assume epoll is always present X-Git-Tag: v11.0.0-rc0~9^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecec2bd8f36e61d5513564e5cdfdf05dd92948cb;p=thirdparty%2Fqemu.git 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 Signed-off-by: Michael Tokarev --- diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1f28e7e93fd..7832a1aba53 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -73,9 +73,7 @@ #ifdef CONFIG_EVENTFD #include #endif -#ifdef CONFIG_EPOLL #include -#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 20d862fd8b1..aac8b0c574d 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;