/* Define if we have LibreSSL */
#undef HAVE_LIBRESSL
+/* If we have atomic_store */
+#undef HAVE_LINK_ATOMIC_STORE
+
/* Define to 1 if you have the <linux/net_tstamp.h> header file. */
#undef HAVE_LINUX_NET_TSTAMP_H
printf "%s\n" "#define DARWIN_BROKEN_SETREUID 1" >>confdefs.h
fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for atomic_store" >&5
+printf %s "checking for atomic_store... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+#ifdef HAVE_STDATOMIC_H
+#include <stdatomic.h>
+#endif
+
+int
+main (void)
+{
+
+ int newvar = 5, var = 0;
+ atomic_store((_Atomic int*)&var, newvar);
+ newvar = 0;
+ /* condition to use the variables. */
+ if(var == newvar) return 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define HAVE_LINK_ATOMIC_STORE 1" >>confdefs.h
+
+
+else $as_nop
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+
ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "
$ac_includes_default
#ifdef HAVE_NETINET_IN_H
if echo $host_os | grep darwin8 > /dev/null; then
AC_DEFINE(DARWIN_BROKEN_SETREUID, 1, [Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work])
fi
+
+AC_MSG_CHECKING([for atomic_store])
+AC_LINK_IFELSE([AC_LANG_PROGRAM(AC_INCLUDES_DEFAULT [[
+#ifdef HAVE_STDATOMIC_H
+#include <stdatomic.h>
+#endif
+]], [[
+ int newvar = 5, var = 0;
+ atomic_store((_Atomic int*)&var, newvar);
+ newvar = 0;
+ /* condition to use the variables. */
+ if(var == newvar) return 1;
+]])], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LINK_ATOMIC_STORE, 1, [If we have atomic_store])
+], [
+ AC_MSG_RESULT([no])
+])
+
AC_CHECK_DECLS([inet_pton,inet_ntop], [], [], [
AC_INCLUDES_DEFAULT
#ifdef HAVE_NETINET_IN_H
* the xfer elements can continue to be their callbacks. */
}
-#ifdef ATOMIC_POINTER_LOCK_FREE
+#if defined(ATOMIC_POINTER_LOCK_FREE) && defined(HAVE_LINK_ATOMIC_STORE)
/** Fast reload thread, if atomics are available, copy the config items
* one by one with atomic store operations. */
static void
#endif
COPY_VAR_int(ede);
}
-#endif /* ATOMIC_POINTER_LOCK_FREE */
+#endif /* ATOMIC_POINTER_LOCK_FREE && HAVE_LINK_ATOMIC_STORE */
/** fast reload thread, adjust the cache sizes */
static void
lock_basic_lock(&env->anchors->lock);
}
-#ifdef ATOMIC_POINTER_LOCK_FREE
+#if defined(ATOMIC_POINTER_LOCK_FREE) && defined(HAVE_LINK_ATOMIC_STORE)
if(fr->fr_nopause) {
fr_atomic_copy_cfg(ct->oldcfg, env->cfg, newcfg);
} else {
*ct->oldcfg = *env->cfg;
/* Insert new config elements. */
*env->cfg = *newcfg;
-#ifdef ATOMIC_POINTER_LOCK_FREE
+#if defined(ATOMIC_POINTER_LOCK_FREE) && defined(HAVE_LINK_ATOMIC_STORE)
}
#endif
log_ident_set_or_default(env->cfg->log_identity);
}
/* the newcfg elements are in env->cfg, so should not be freed here. */
-#ifdef ATOMIC_POINTER_LOCK_FREE
+#if defined(ATOMIC_POINTER_LOCK_FREE) && defined(HAVE_LINK_ATOMIC_STORE)
/* if used, the routine that copies the config has zeroed items. */
if(!fr->fr_nopause)
#endif
+9 April 2025: Wouter
+ - Fix to detect if atomic_store links in configure.
+
8 April 2025: Wouter
- Tag for 1.23.0rc1.
- Fix fast_reload to print chroot with config file name.