Index: lib/Fuzzer/FuzzerUtil.cpp =================================================================== --- lib/Fuzzer/FuzzerUtil.cpp +++ lib/Fuzzer/FuzzerUtil.cpp @@ -113,7 +113,13 @@ void SetSigTermHandler() { SetSigaction(SIGTERM, InterruptHandler); } int NumberOfCpuCores() { +#ifdef __linux__ FILE *F = popen("nproc", "r"); +#elif __APPLE__ + FILE *F = popen("sysctl -n hw.ncpu", "r"); +#else +#error "NumberOfCpuCores() is not implemented for your platform" +#endif int N = 0; if (fscanf(F, "%d", &N) != 1) N = 1;