1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 14:48:11 +00:00

LibCore: Use new global variables at /sys/kernel/ directory

This commit is contained in:
Liav A 2022-10-14 21:55:33 +03:00 committed by Andrew Kaster
parent 5dfb2b18f3
commit c7dca00b65
2 changed files with 4 additions and 4 deletions

View file

@ -20,13 +20,13 @@ Optional<AllProcessesStatistics> ProcessStatisticsReader::get_all(RefPtr<Core::F
{
if (proc_all_file) {
if (!proc_all_file->seek(0, Core::SeekMode::SetPosition)) {
warnln("ProcessStatisticsReader: Failed to refresh /proc/all: {}", proc_all_file->error_string());
warnln("ProcessStatisticsReader: Failed to refresh /sys/kernel/processes: {}", proc_all_file->error_string());
return {};
}
} else {
proc_all_file = Core::File::construct("/proc/all");
proc_all_file = Core::File::construct("/sys/kernel/processes");
if (!proc_all_file->open(Core::OpenMode::ReadOnly)) {
warnln("ProcessStatisticsReader: Failed to open /proc/all: {}", proc_all_file->error_string());
warnln("ProcessStatisticsReader: Failed to open /sys/kernel/processes: {}", proc_all_file->error_string());
return {};
}
}

View file

@ -34,7 +34,7 @@ struct ThreadStatistics {
};
struct ProcessStatistics {
// Keep this in sync with /proc/all.
// Keep this in sync with /sys/kernel/processes.
// From the kernel side:
pid_t pid;
pid_t pgid;