;;
darwin*)
CXXFLAGS="-D__APPLE_USE_RFC_3542 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS"
+ have_darwin="yes"
;;
freebsd*)
THREADFLAGS="-pthread"
AM_CONDITIONAL([HAVE_FREEBSD], [test "x$have_freebsd" = "xyes"])
AM_CONDITIONAL([HAVE_OPENBSD], [test "x$have_openbsd" = "xyes"])
AM_CONDITIONAL([HAVE_LINUX], [test "x$have_linux" = "xyes"])
+ AM_CONDITIONAL([HAVE_DARWIN], [test "x$have_darwin" = "xyes"])
AM_CONDITIONAL([HAVE_SOLARIS], [test "x$have_solaris" = "xyes"])
AC_MSG_CHECKING([whether -latomic is needed for __atomic builtins])
#include <unistd.h>
#include "misc.hh"
#include <sys/types.h>
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
#include <sys/event.h>
#endif
#include <sys/time.h>
}
else {
try {
- const struct timeval timeout{ g_networkTimeoutMsec / 1000, g_networkTimeoutMsec % 1000 * 1000};
+ const struct timeval timeout{ g_networkTimeoutMsec / 1000, static_cast<suseconds_t>(g_networkTimeoutMsec) % 1000 * 1000};
Socket s(ip.sin4.sin_family, SOCK_STREAM);
s.setNonBlocking();
struct tm tm;
size_t len = strftime(buf, sz, s_timestampFormat.c_str(), localtime_r(&tv.tv_sec, &tm));
if (len == 0) {
- len = snprintf(buf, sz, "%lld", (long long) tv.tv_sec);
+ len = snprintf(buf, sz, "%lld", static_cast<long long>(tv.tv_sec));
}
- snprintf(buf + len, sz - len, ".%03ld", tv.tv_usec / 1000);
+ snprintf(buf + len, sz - len, ".%03ld", static_cast<long>(tv.tv_usec) / 1000);
return buf;
}
Socket s(remote.sin4.sin_family, SOCK_STREAM);
s.setNonBlocking();
std::shared_ptr<TLSCtx> tlsCtx{nullptr};
- const struct timeval timeout{g_networkTimeoutMsec / 1000, g_networkTimeoutMsec % 1000 * 1000};
+ const struct timeval timeout{g_networkTimeoutMsec / 1000, static_cast<suseconds_t>(g_networkTimeoutMsec) % 1000 * 1000};
auto handler = std::make_shared<TCPIOHandler>("", s.releaseHandle(), timeout, tlsCtx, time(nullptr));
handler->tryConnect(SyncRes::s_tcp_fast_open_connect, remote);// we do the connect so the first attempt happens while we gather stats
testrunner_SOURCES += kqueuemplexer.cc
endif
+if HAVE_DARWIN
+pdns_recursor_SOURCES += kqueuemplexer.cc
+testrunner_SOURCES += kqueuemplexer.cc
+endif
+
if HAVE_LINUX
pdns_recursor_SOURCES += epollmplexer.cc
testrunner_SOURCES += epollmplexer.cc
yarl.initialize(&req);
client->setNonBlocking();
- const struct timeval timeout{g_networkTimeoutMsec / 1000, g_networkTimeoutMsec % 1000 * 1000};
+ const struct timeval timeout{g_networkTimeoutMsec / 1000, static_cast<suseconds_t>(g_networkTimeoutMsec) % 1000 * 1000};
std::shared_ptr<TLSCtx> tlsCtx{nullptr};
auto handler = std::make_shared<TCPIOHandler>("", client->releaseHandle(), timeout, tlsCtx, time(nullptr));