2016-11-20 17:02:27 +05:30
|
|
|
#include "sys.h"
|
|
|
|
|
2016-11-26 06:48:05 +05:30
|
|
|
#include <sys/utsname.h>
|
|
|
|
|
|
|
|
Sys::KernelInfo Sys::getKernelInfo()
|
2016-11-20 17:02:27 +05:30
|
|
|
{
|
2016-11-26 06:48:05 +05:30
|
|
|
Sys::KernelInfo out;
|
|
|
|
struct utsname buf;
|
|
|
|
uname(&buf);
|
|
|
|
out.kernelName = buf.sysname;
|
|
|
|
out.kernelVersion = buf.release;
|
|
|
|
return out;
|
2016-11-20 17:02:27 +05:30
|
|
|
}
|
2016-11-22 05:27:15 +05:30
|
|
|
|
|
|
|
#include <sys/sysctl.h>
|
|
|
|
|
|
|
|
uint64_t Sys::getSystemRam()
|
|
|
|
{
|
|
|
|
uint64_t memsize;
|
|
|
|
size_t memsizesize = sizeof(memsize);
|
|
|
|
if(!sysctlbyname("hw.memsize", &memsize, &memsizesize, NULL, 0))
|
|
|
|
{
|
|
|
|
return memsize;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Sys::isCPU64bit()
|
|
|
|
{
|
|
|
|
// not even going to pretend I'm going to support anything else
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Sys::isSystem64bit()
|
|
|
|
{
|
|
|
|
// yep. maybe when we have 128bit CPUs on consumer devices.
|
|
|
|
return true;
|
|
|
|
}
|
2018-03-12 03:30:54 +05:30
|
|
|
|
|
|
|
Sys::DistributionInfo Sys::getDistributionInfo()
|
|
|
|
{
|
|
|
|
DistributionInfo result;
|
|
|
|
return result;
|
|
|
|
}
|