summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2021-12-26 21:37:31 +0300
committerMatthew Pickering <matthewtpickering@gmail.com>2022-02-07 15:41:43 +0000
commit29c8c561a39dac433da72091157dc035ccaa58f3 (patch)
tree4e859e7d4be5e709748976ae65051ab42bf32f28
parent27581d77d489119da5dc1104793503b10240660d (diff)
downloadhaskell-wip/fix-freebsd.tar.gz
Fix build on recent FreeBSD.wip/fix-freebsd
Recent FreeBSD versions gained the sched_getaffinity function, which made two mutually exclusive #ifdef blocks to be enabled.
-rw-r--r--rts/posix/OSThreads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 862e6007a6..20064910ad 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -331,7 +331,7 @@ getNumberOfProcessors (void)
nproc = 1;
}
}
-#elif defined(freebsd_HOST_OS)
+#elif defined(freebsd_HOST_OS) && !defined(HAVE_SCHED_GETAFFINITY)
cpuset_t mask;
CPU_ZERO(&mask);
if(cpuset_getaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, sizeof(mask), &mask) == 0) {