Skip to content

Commit 34cf741

Browse files
committed
Fix macos build
1 parent 4a4faae commit 34cf741

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/unit/test_svs_tiered.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
// Returns the number of logical processors on the process
3232
// Returns std::thread::hardware_concurrency() if the number of logical processors is not available
3333
static unsigned int getAvailableCPUs() {
34+
#ifdef __linux__
3435
// On Linux, use sched_getaffinity to get the number of CPUs available to the current process.
3536
cpu_set_t cpu_set;
3637
if (sched_getaffinity(0, sizeof(cpu_set), &cpu_set) == 0) {
3738
return CPU_COUNT(&cpu_set);
3839
}
40+
#endif
3941
// Fallback.
4042
return std::thread::hardware_concurrency();
4143
}

0 commit comments

Comments
 (0)