summaryrefslogtreecommitdiffstats
path: root/libraries/ganalytics/src/sys_apple.cpp
blob: 49a611656269ce4c59fdab5f1b4ae2627a1f4da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "sys.h"

#include <sys/utsname.h>

Sys::KernelInfo Sys::getKernelInfo()
{
	Sys::KernelInfo out;
	struct utsname buf;
	uname(&buf);
	out.kernelName = buf.sysname;
	out.kernelVersion = buf.release;
	return out;
}

#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;
}