[PATCH trivial v2 7/7] rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL, and stop checking for epoll in meson.build

Michael Tokarev posted 7 patches 3 weeks ago
Only 3 patches received!
[PATCH trivial v2 7/7] rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL, and stop checking for epoll in meson.build
Posted by Michael Tokarev 3 weeks ago
Since CONFIG_EPOLL is now unused, it's okay to
perform this rename, to make it less ugly.

Since epoll is linux-specific and is always present on linux,
define CONFIG_EPOLL to 1 on linux, without compile-time test.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 meson.build      | 3 +--
 util/aio-posix.h | 4 ++--
 util/meson.build | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index f4eae50764..157189e306 100644
--- a/meson.build
+++ b/meson.build
@@ -2673,8 +2673,7 @@ config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)
 # has_header_symbol
 config_host_data.set('CONFIG_BLKZONED',
                      cc.has_header_symbol('linux/blkzoned.h', 'BLKOPENZONE'))
-config_host_data.set('CONFIG_EPOLL_CREATE1',
-                     cc.has_header_symbol('sys/epoll.h', 'epoll_create1'))
+config_host_data.set('CONFIG_EPOLL', host_os == 'linux')
 config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE',
                      cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_PUNCH_HOLE') and
                      cc.has_header_symbol('linux/falloc.h', 'FALLOC_FL_KEEP_SIZE'))
diff --git a/util/aio-posix.h b/util/aio-posix.h
index 0cedb8d189..ab894a3c0f 100644
--- a/util/aio-posix.h
+++ b/util/aio-posix.h
@@ -52,7 +52,7 @@ extern const FDMonOps fdmon_poll_ops;
 /* Switch back to poll(2). list_lock must be held. */
 void fdmon_poll_downgrade(AioContext *ctx);
 
-#ifdef CONFIG_EPOLL_CREATE1
+#ifdef CONFIG_EPOLL
 bool fdmon_epoll_try_upgrade(AioContext *ctx, unsigned npfd);
 void fdmon_epoll_setup(AioContext *ctx);
 
@@ -71,7 +71,7 @@ static inline void fdmon_epoll_setup(AioContext *ctx)
 static inline void fdmon_epoll_disable(AioContext *ctx)
 {
 }
-#endif /* !CONFIG_EPOLL_CREATE1 */
+#endif /* !CONFIG_EPOLL */
 
 #ifdef CONFIG_LINUX_IO_URING
 bool fdmon_io_uring_setup(AioContext *ctx, Error **errp);
diff --git a/util/meson.build b/util/meson.build
index 59e835a8d3..8c01d7a3de 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -3,7 +3,7 @@ util_ss.add(files('thread-context.c'), numa)
 if host_os != 'windows'
   util_ss.add(files('aio-posix.c'))
   util_ss.add(files('fdmon-poll.c'))
-  if config_host_data.get('CONFIG_EPOLL_CREATE1')
+  if config_host_data.get('CONFIG_EPOLL')
     util_ss.add(files('fdmon-epoll.c'))
   endif
   util_ss.add(files('compatfd.c'))
-- 
2.47.3
Re: [PATCH trivial v2 7/7] rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL, and stop checking for epoll in meson.build
Posted by Richard Henderson 1 week ago
On 1/20/26 00:05, Michael Tokarev wrote:
> Since CONFIG_EPOLL is now unused, it's okay to
> perform this rename, to make it less ugly.
> 
> Since epoll is linux-specific and is always present on linux,
> define CONFIG_EPOLL to 1 on linux, without compile-time test.
> 
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>   meson.build      | 3 +--
>   util/aio-posix.h | 4 ++--
>   util/meson.build | 2 +-
>   3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index f4eae50764..157189e306 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2673,8 +2673,7 @@ config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)
>   # has_header_symbol
>   config_host_data.set('CONFIG_BLKZONED',
>                        cc.has_header_symbol('linux/blkzoned.h', 'BLKOPENZONE'))
> -config_host_data.set('CONFIG_EPOLL_CREATE1',
> -                     cc.has_header_symbol('sys/epoll.h', 'epoll_create1'))
> +config_host_data.set('CONFIG_EPOLL', host_os == 'linux')

I guess my question remains: Why keep CONFIG_EPOLL if it is identical to the existing 
CONFIG_LINUX?


r~
Re: [PATCH trivial v2 7/7] rename CONFIG_EPOLL_CREATE1 to CONFIG_EPOLL, and stop checking for epoll in meson.build
Posted by Michael Tokarev 6 days, 23 hours ago
On 2/3/26 05:36, Richard Henderson wrote:
> On 1/20/26 00:05, Michael Tokarev wrote:
>> Since CONFIG_EPOLL is now unused, it's okay to
>> perform this rename, to make it less ugly.
>>
>> Since epoll is linux-specific and is always present on linux,
>> define CONFIG_EPOLL to 1 on linux, without compile-time test.
>>
>> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>> ---
>>   meson.build      | 3 +--
>>   util/aio-posix.h | 4 ++--
>>   util/meson.build | 2 +-
>>   3 files changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index f4eae50764..157189e306 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -2673,8 +2673,7 @@ config_host_data.set('CONFIG_INOTIFY1', 
>> have_inotify_init1)
>>   # has_header_symbol
>>   config_host_data.set('CONFIG_BLKZONED',
>>                        cc.has_header_symbol('linux/blkzoned.h', 
>> 'BLKOPENZONE'))
>> -config_host_data.set('CONFIG_EPOLL_CREATE1',
>> -                     cc.has_header_symbol('sys/epoll.h', 
>> 'epoll_create1'))
>> +config_host_data.set('CONFIG_EPOLL', host_os == 'linux')
> 
> I guess my question remains: Why keep CONFIG_EPOLL if it is identical to 
> the existing CONFIG_LINUX?

It would be less obvious this way in the code.  When you've some
#ifdef, when using CONFIG_EPOLL, it's much more obvious why it's here.
When it's CONFIG_LINUX, you start to wonder which of the 100500
different linux-only features this place is about.

Current code very obviously uses configuration test for particular
_feature_ (presence of epoll).  Yes, this interface is linux-specific,
but in my view it is better to keep depending on particular feature,
than to check of the os type or library version or something else like
that.

Thanks,

/mjt