| 445 | } |
| 446 | |
| 447 | u64 OS::getRamSize() { |
| 448 | static u64 mem_total = 0; |
| 449 | |
| 450 | if (mem_total == 0) { |
| 451 | FILE* file = fopen("/proc/meminfo", "r"); |
| 452 | if (!file) return 0; |
| 453 | |
| 454 | char line[1024]; |
| 455 | while (fgets(line, sizeof(line), file)) { |
| 456 | if (strncmp(line, "MemTotal:", 9) == 0) { |
| 457 | mem_total = strtoull(line + 9, NULL, 10) * 1024; |
| 458 | break; |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | fclose(file); |
| 463 | } |
| 464 | |
| 465 | return mem_total; |
| 466 | } |
| 467 | |
| 468 | u64 OS::getSystemBootTime() { |
| 469 | static u64 system_boot_time = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected