[PATCH 1/3] freebsd: FreeBSD 15 has native inotify

Warner Losh posted 3 patches 11 hours ago
Maintainers: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
There is a newer version of this series
[PATCH 1/3] freebsd: FreeBSD 15 has native inotify
Posted by Warner Losh 11 hours ago
Check to make sure that we have inotify in libc, before looking for it
in libinotify.

Sponsored by:		Netflix
---
 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)

-- 
2.52.0
Re: [PATCH 1/3] freebsd: FreeBSD 15 has native inotify
Posted by Warner Losh 10 hours ago
On Tue, Feb 10, 2026 at 8:07 AM Warner Losh <imp@bsdimp.com> wrote:

> Check to make sure that we have inotify in libc, before looking for it
> in libinotify.
>
> Sponsored by:           Netflix
>

Opps, added the wrong SOB here (this is for a different project). This work
wasn't sponsored by Netflix. I'll fix in v2.

I just need Paolo, or somebody, to give it a nod.

Warner


> ---
>  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)
>
> --
> 2.52.0
>
>