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