diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-05-09 18:55:25 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-30 06:07:31 -0400 |
commit | 4413828b7c507872c56719fb8920e1c2322830f8 (patch) | |
tree | 32754a94c9fd720fff4023081dcce9169999b062 /configure.ac | |
parent | aac19e6caa0c94e159610f124114186ee20bcdd1 (diff) | |
download | haskell-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.ac | 2 |
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 |