2020-05-04 02:15:27 +00:00
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
2020-11-27 17:57:20 +00:00
|
|
|
using System.Runtime.Versioning;
|
2020-05-04 02:15:27 +00:00
|
|
|
|
|
|
|
namespace Ryujinx.Common.SystemInfo
|
|
|
|
{
|
2020-11-27 17:57:20 +00:00
|
|
|
[SupportedOSPlatform("linux")]
|
2020-12-01 21:26:00 +00:00
|
|
|
internal class LinuxSystemInfo : SystemInfo
|
2020-05-04 02:15:27 +00:00
|
|
|
{
|
|
|
|
public override string CpuName { get; }
|
|
|
|
public override ulong RamSize { get; }
|
|
|
|
|
2020-12-01 21:26:00 +00:00
|
|
|
public LinuxSystemInfo()
|
2020-05-04 02:15:27 +00:00
|
|
|
{
|
|
|
|
CpuName = File.ReadAllLines("/proc/cpuinfo").Where(line => line.StartsWith("model name")).ToList()[0].Split(":")[1].Trim();
|
|
|
|
RamSize = ulong.Parse(File.ReadAllLines("/proc/meminfo")[0].Split(":")[1].Trim().Split(" ")[0]) * 1024;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|