| 466 | } |
| 467 | |
| 468 | u64 OS::getSystemBootTime() { |
| 469 | static u64 system_boot_time = 0; |
| 470 | |
| 471 | if (system_boot_time == 0) { |
| 472 | FILE* file = fopen("/proc/stat", "r"); |
| 473 | if (!file) return 0; |
| 474 | |
| 475 | char line[1024]; |
| 476 | while (fgets(line, sizeof(line), file)) { |
| 477 | if (strncmp(line, "btime", 5) == 0) { |
| 478 | system_boot_time = strtoull(line + 5, NULL, 10); |
| 479 | break; |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | fclose(file); |
| 484 | } |
| 485 | |
| 486 | return system_boot_time; |
| 487 | } |
| 488 | |
| 489 | int OS::getProcessIds(int* pids, int max_pids) { |
| 490 | int count = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected