[Dnsmasq-discuss] [PATCH] Enable inotify support on FreeBSD 15.

Matthias Andree matthias.andree at gmx.de
Sat Dec 20 09:16:47 UTC 2025


FreeBSD 15.0 has added Linux-compatible inotify support, so
enable it by looking if the version matches. Since FreeBSD inotify has
seen a few bug fixes in 2025H2, so only enable it if
__FreeBSD_version >= 1500068.  The latter can be checked through
osreldate.h or sys/param.h; the latter defines more macros that clash
with dnsmasq's, such as MIN and MAX, so use the former.
---
 CHANGELOG    | 3 +++
 src/config.h | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 32981f8..e12d4d3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -76,6 +76,9 @@ version 2.92
 	using TCP. Thanks to Bruno Ravara for spotting and
 	characterising this bug.
 
+	Enable support for inotify on FreeBSD 15.0-RELEASE, which added
+	Linux-compatible inotify support.
+
 	
 version 2.91
 	Fix spurious "resource limit exceeded messages". Thanks to 
diff --git a/src/config.h b/src/config.h
index 0994f95..191c72e 100644
--- a/src/config.h
+++ b/src/config.h
@@ -142,7 +142,8 @@ HAVE_LOOP
    include functionality to probe for and remove DNS forwarding loops.
 
 HAVE_INOTIFY
-   use the Linux inotify facility to efficiently re-read configuration files.
+   use the Linux and FreeBSD >= 15 inotify facility
+   to efficiently re-read configuration files.
 
 NO_ID
    Don't report *.bind CHAOS info to clients, forward such requests upstream instead.
@@ -378,6 +379,12 @@ HAVE_SOCKADDR_SA_LEN
 #if defined (HAVE_LINUX_NETWORK) && !defined(NO_INOTIFY)
 #define HAVE_INOTIFY
 #endif
+#if defined (__FreeBSD__) && __FreeBSD__ + 0 >= 15
+# include <osreldate.h>
+# if __FreeBSD_version >= 1500068 /* 15.0.0 */
+#  define HAVE_INOTIFY
+# endif
+#endif
 
 /* This never compiles code, it's only used by the makefile to fingerprint builds. */
 #ifdef DNSMASQ_COMPILE_FLAGS
-- 
2.52.0




More information about the Dnsmasq-discuss mailing list