From 2bedc5757cfad4a222a02e74ee11a5debd70a810 Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Thu, 24 May 2018 13:57:47 -0700 Subject: [PATCH] Use sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_ONLN) (#18053) --- src/gc/unix/gcenv.unix.cpp | 2 +- src/pal/src/misc/sysinfo.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gc/unix/gcenv.unix.cpp b/src/gc/unix/gcenv.unix.cpp index 737c5ef..fe7543d 100644 --- a/src/gc/unix/gcenv.unix.cpp +++ b/src/gc/unix/gcenv.unix.cpp @@ -67,7 +67,7 @@ bool GCToOSInterface::Initialize() g_pageSizeUnixInl = uint32_t((pageSize > 0) ? pageSize : 0x1000); // Calculate and cache the number of processors on this machine - int cpuCount = sysconf(_SC_NPROCESSORS_ONLN); + int cpuCount = sysconf(_SC_NPROCESSORS_CONF); if (cpuCount == -1) { return false; diff --git a/src/pal/src/misc/sysinfo.cpp b/src/pal/src/misc/sysinfo.cpp index bc55dad..18403f0 100644 --- a/src/pal/src/misc/sysinfo.cpp +++ b/src/pal/src/misc/sysinfo.cpp @@ -103,10 +103,10 @@ PAL_GetLogicalCpuCountFromOS() int nrcpus = 0; #if HAVE_SYSCONF - nrcpus = sysconf(_SC_NPROCESSORS_ONLN); + nrcpus = sysconf(_SC_NPROCESSORS_CONF); if (nrcpus < 1) { - ASSERT("sysconf failed for _SC_NPROCESSORS_ONLN (%d)\n", errno); + ASSERT("sysconf failed for _SC_NPROCESSORS_CONF (%d)\n", errno); } #elif HAVE_SYSCTL int rc; -- 2.7.4