On 24.02.2026 17:40, Warner Losh wrote:
Check to make sure that we have inotify in libc, before looking for it
in libinotify.

Cc: Paolo Bonzini <[email protected]>
Cc: Marc-André Lureau <[email protected]>
Cc: Daniel P. Berrange <[email protected]>
Cc: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Warner Losh <[email protected]>
---
  meson.build      | 14 +++++---------
  util/meson.build |  6 +-----
  2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/meson.build b/meson.build
index 4af32c3e1f..3d761f89b5 100644
--- a/meson.build
+++ b/meson.build
@@ -2664,18 +2664,14 @@ else
  endif
  config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber)
+inotify = not_found
  have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
  have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
-inotify = not_found
-if (have_inotify_init or have_inotify_init1) and host_os == 'freebsd'
-  # libinotify-kqueue
+if (have_inotify_init or have_inotify_init1) and not 
cc.has_function('inotify_init1')
+  # FreeBSD 14 and older need libinotify-kqueue wrapper
    inotify = cc.find_library('inotify')
-  if have_inotify_init
-    have_inotify_init = inotify.found()
-  endif
-  if have_inotify_init1
-    have_inotify_init1 = inotify.found()
-  endif
+  have_inotify_init = have_inotify_init and inotify.found()
+  have_inotify_init1 = have_inotify_init1 and inotify.found()
  endif
  config_host_data.set('CONFIG_INOTIFY', have_inotify_init)
  config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)

Does freebsd have inotify_init() or inotify_init1() or both?

I sent another patch for this area, which drops checking for
the original/early inotify_init(), because this function is
actually not used in qemu, - qemu only uses the more modern
inotify_init1() interface.

Now my change clashes with this change in a fun way.

Do we really need to check for inotify_init() at all?

Thanks,

/mjt

Reply via email to