Use sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_ONLN) (dotnet...
authorEgor Chesakov <Egor.Chesakov@microsoft.com>
Thu, 24 May 2018 20:57:47 +0000 (13:57 -0700)
committerGitHub <noreply@github.com>
Thu, 24 May 2018 20:57:47 +0000 (13:57 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/2bedc5757cfad4a222a02e74ee11a5debd70a810

src/coreclr/src/gc/unix/gcenv.unix.cpp
src/coreclr/src/pal/src/misc/sysinfo.cpp

index 737c5ef..fe7543d 100644 (file)
@@ -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;
index bc55dad..18403f0 100644 (file)
@@ -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;