]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
[PATCH]: Recursor 4.1.0 alpha 1 fails to build on FreeBSD
authorRvdE <tremere@cainites.net>
Thu, 31 Aug 2017 18:58:31 +0000 (20:58 +0200)
committerGitHub <noreply@github.com>
Thu, 31 Aug 2017 18:58:31 +0000 (20:58 +0200)
This fixes compilation on FreeBSD, which requires an extra include file and defines a slightly different type.

pdns/misc.cc

index 0592836d2f86615ee1ea1e8e763539dc4a396484..73c54c6a84ffb0e0f3a8ec1e8d535546122aca98 100644 (file)
@@ -57,7 +57,9 @@
 #include <sys/types.h>
 #include <pwd.h>
 #include <grp.h>
-
+#ifdef __FreeBSD__
+#  include <pthread_np.h>
+#endif
 
 bool g_singleThreaded;
 
@@ -1323,6 +1325,9 @@ bool isSettingThreadCPUAffinitySupported()
 int mapThreadToCPUList(pthread_t tid, const std::set<int>& cpus)
 {
 #ifdef HAVE_PTHREAD_SETAFFINITY_NP
+#  ifndef cpu_set_t
+#    define cpu_set_t cpuset_t
+#  endif
   cpu_set_t cpuset;
   CPU_ZERO(&cpuset);
   for (const auto cpuID : cpus) {