MCPcopy Create free account
hub / github.com/Kitware/CMake / QuerySolarisMemory

Method QuerySolarisMemory

Source/kwsys/SystemInformation.cxx:4917–4939  ·  view source on GitHub ↗

Querying for system information from Solaris */

Source from the content-addressed store, hash-verified

4915
4916/** Querying for system information from Solaris */
4917bool SystemInformationImplementation::QuerySolarisMemory()
4918{
4919#if defined(__SVR4) && defined(__sun)
4920// Solaris allows querying this value by sysconf, but if this is
4921// a 32 bit process on a 64 bit host the returned memory will be
4922// limited to 4GiB. So if this is a 32 bit process or if the sysconf
4923// method fails use the kstat interface.
4924# if SIZEOF_VOID_P == 8
4925 if (this->QueryMemoryBySysconf()) {
4926 return true;
4927 }
4928# endif
4929
4930 char* tail;
4931 unsigned long totalMemory =
4932 strtoul(this->ParseValueFromKStat("-s physmem").c_str(), &tail, 0);
4933 this->TotalPhysicalMemory = totalMemory / 128;
4934
4935 return true;
4936#else
4937 return false;
4938#endif
4939}
4940
4941bool SystemInformationImplementation::QuerySolarisProcessor()
4942{

Callers 1

RunMemoryCheckMethod · 0.95

Calls 3

QueryMemoryBySysconfMethod · 0.95
ParseValueFromKStatMethod · 0.95
c_strMethod · 0.80

Tested by

no test coverage detected