Merge pull request #61 from ideasman42/linux-frameserver-sysconf-fix
Linux: Frameserver system memory access
This commit is contained in:
commit
a09dc1b458
1 changed files with 10 additions and 0 deletions
|
@ -49,6 +49,10 @@ using namespace std;
|
||||||
#include <sys/sysctl.h> //To retrieve MAC HW infos
|
#include <sys/sysctl.h> //To retrieve MAC HW infos
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LINUX
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// forward declaration
|
// forward declaration
|
||||||
class FarmServer;
|
class FarmServer;
|
||||||
|
|
||||||
|
@ -693,6 +697,7 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo)
|
||||||
hwInfo.m_type = Irix;
|
hwInfo.m_type = Irix;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#ifdef MACOSX
|
||||||
int mib[2];
|
int mib[2];
|
||||||
TINT64 physMemSize;
|
TINT64 physMemSize;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
@ -701,6 +706,11 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo)
|
||||||
mib[1] = HW_MEMSIZE;
|
mib[1] = HW_MEMSIZE;
|
||||||
len = sizeof(physMemSize);
|
len = sizeof(physMemSize);
|
||||||
sysctl(mib, 2, &physMemSize, &len, NULL, 0);
|
sysctl(mib, 2, &physMemSize, &len, NULL, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LINUX
|
||||||
|
TINT64 physMemSize = (TINT64)sysconf(_SC_PHYS_PAGES) * (TINT64)sysconf(_SC_PAGE_SIZE);
|
||||||
|
#endif
|
||||||
|
|
||||||
hwInfo.m_cpuCount = TSystem::getProcessorCount();
|
hwInfo.m_cpuCount = TSystem::getProcessorCount();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue