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
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
// forward declaration
|
||||
class FarmServer;
|
||||
|
||||
|
@ -693,6 +697,7 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo)
|
|||
hwInfo.m_type = Irix;
|
||||
#else
|
||||
|
||||
#ifdef MACOSX
|
||||
int mib[2];
|
||||
TINT64 physMemSize;
|
||||
size_t len;
|
||||
|
@ -701,6 +706,11 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo)
|
|||
mib[1] = HW_MEMSIZE;
|
||||
len = sizeof(physMemSize);
|
||||
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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue