summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-09 18:55:25 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-30 06:07:31 -0400
commit4413828b7c507872c56719fb8920e1c2322830f8 (patch)
tree32754a94c9fd720fff4023081dcce9169999b062 /configure.ac
parentaac19e6caa0c94e159610f124114186ee20bcdd1 (diff)
downloadhaskell-4413828b7c507872c56719fb8920e1c2322830f8.tar.gz
rts: Teach getNumProcessors to return available processors
Previously we would report the number of physical processors, which can be quite wrong in a containerized setting. Now we rather return how many processors are in our affinity mask when possible. I also refactored the code to prefer platform-specific since this will report logical CPUs instead of physical (using `machdep.cpu.thread_count` on Darwin and `cpuset_getaffinity` on FreeBSD). Fixes #14781.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index bac2cfde5e..f7b02e8dcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -978,7 +978,7 @@ FP_CHECK_FUNC([GetModuleFileName],
dnl ** check for more functions
dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too.
-AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r sched_setaffinity setlocale])
+AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r sched_setaffinity sched_getaffinity setlocale])
dnl ** On OS X 10.4 (at least), time.h doesn't declare ctime_r if
dnl ** _POSIX_C_SOURCE is defined