All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] freebsd: FreeBSD 15 has native inotify
@ 2026-02-10 15:43 Warner Losh
  2026-02-10 15:54 ` Daniel P. Berrangé
  0 siblings, 1 reply; 3+ messages in thread
From: Warner Losh @ 2026-02-10 15:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Marc-André Lureau, Daniel P. Berrangé,
	Philippe Mathieu-Daudé, Warner Losh

Check to make sure that we have inotify in libc, before looking for it
in libinotify.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Daniel P. Berrange <berrange@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
FreeBSD 15 and newer now has a native inotify implementation. Check for
it before checking for the wrapper libinotify library which is needed in
FreeBSD 14 and earlier. Make the check dependent on symbols, not host
version.

Separate series because it's really independent of the two other
patch series I have submitted and it is more important.
---
 meson.build | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/meson.build b/meson.build
index 2d114e9018..537f50283f 100644
--- a/meson.build
+++ b/meson.build
@@ -2662,13 +2662,15 @@ 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
-  inotify = cc.find_library('inotify')
-  if have_inotify_init
-    have_inotify_init = inotify.found()
-  endif
-  if have_inotify_init1
-    have_inotify_init1 = inotify.found()
+  if not cc.has_function('inotify_init') and not cc.has_function('inotify_init1')
+    inotify = cc.find_library('inotify')
+    # libinotify-kqueue
+    if have_inotify_init
+      have_inotify_init = inotify.found()
+    endif
+    if have_inotify_init1
+      have_inotify_init1 = inotify.found()
+    endif
   endif
 endif
 config_host_data.set('CONFIG_INOTIFY', have_inotify_init)

---
base-commit: 0b91040d23dc8820724a60c811223b777f3bc6b7
change-id: 20260210-freebsd-inotify-8bd07b2c84d1

Best regards,
-- 
Warner Losh <imp@bsdimp.com>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-10 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 15:43 [PATCH] freebsd: FreeBSD 15 has native inotify Warner Losh
2026-02-10 15:54 ` Daniel P. Berrangé
2026-02-10 18:22   ` Warner Losh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.