Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Use sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_…
Browse files Browse the repository at this point in the history
…ONLN) (#18053)
  • Loading branch information
echesakov authored May 24, 2018
1 parent c0150d4 commit 2bedc57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gc/unix/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/pal/src/misc/sysinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2bedc57

Please sign in to comment.