-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #8518
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/cli/utils.c b/cli/utils.c | ||
index c0d75de2..b3a0c34a 100644 | ||
--- a/cli/utils.c | ||
+++ b/cli/utils.c | ||
@@ -671,7 +671,9 @@ int check_break (void) | ||
|
||
#ifdef ENABLE_THREADS | ||
|
||
-#if defined(__GNUC__) && !defined(_WIN32) | ||
+#if defined(__APPLE__) || defined(__NetBSD__) | ||
+#include <sys/sysctl.h> | ||
+#elif defined(__GNUC__) && !defined(_WIN32) | ||
#include <sys/sysinfo.h> | ||
#endif | ||
|
||
@@ -683,6 +685,9 @@ int get_default_worker_threads (void) | ||
SYSTEM_INFO sysinfo; | ||
GetSystemInfo (&sysinfo); | ||
num_processors = sysinfo.dwNumberOfProcessors; | ||
+#elif defined(__APPLE__) || defined(__NetBSD__) | ||
+ size_t len = sizeof (num_processors); | ||
+ sysctlbyname ("hw.ncpu", &num_processors, &len, NULL, 0); | ||
#elif defined (__GNUC__) | ||
num_processors = get_nprocs (); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters