summaryrefslogtreecommitdiff
path: root/common/common.cpp
diff options
context:
space:
mode:
authorviric <viric@viric.name>2024-05-04 15:26:53 +0200
committerGitHub <noreply@github.com>2024-05-04 15:26:53 +0200
commitfcd84a0f5a584ab5271745d7ffef21c8a6bc7b0c (patch)
treefbffa800f0ae901a9bc7ae47322e1bec1232f0d4 /common/common.cpp
parent03fb8a002df2e96104f9e06de9c78d2a8ed91e92 (diff)
Fix Linux /sys cpu path to guess number of cores (#7064)
Diffstat (limited to 'common/common.cpp')
-rw-r--r--common/common.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/common.cpp b/common/common.cpp
index 243b88ab..467fb014 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -76,7 +76,7 @@ int32_t get_num_physical_cores() {
// enumerate the set of thread siblings, num entries is num cores
std::unordered_set<std::string> siblings;
for (uint32_t cpu=0; cpu < UINT32_MAX; ++cpu) {
- std::ifstream thread_siblings("/sys/devices/system/cpu"
+ std::ifstream thread_siblings("/sys/devices/system/cpu/cpu"
+ std::to_string(cpu) + "/topology/thread_siblings");
if (!thread_siblings.is_open()) {
break; // no more cpus