diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp index 12e237093ce..d844a7f4a75 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -292,16 +292,23 @@ PlatformInfo::PlatformInfo(const string& prefix, #elif defined(__linux) IceUtilInternal::ifstream is(string("/proc/cpuinfo")); set<string> ids; + + int nprocessor = 0; while(is) { string line; getline(is, line); - if(line.find("physical id") == 0) + if(line.find("processor") == 0) + { + nprocessor++; + } + else if(line.find("physical id") == 0) { + nprocessor--; ids.insert(line); } } - _nProcessorSockets = ids.size(); + _nProcessorSockets = nprocessor + ids.size(); #else // Not supported _nProcessorSockets = 1; |