1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

Kernel+LibCore: Add process creation time to /sys/kernel/processes

This commit is contained in:
Tim Ledbetter 2023-06-09 17:22:07 +01:00 committed by Andreas Kling
parent 4d49852454
commit f95dccdb45
3 changed files with 4 additions and 0 deletions

View file

@ -42,6 +42,7 @@ ErrorOr<AllProcessesStatistics> ProcessStatisticsReader::get_all(SeekableStream&
process.tty = process_object.get_deprecated_string("tty"sv).value_or("");
process.pledge = process_object.get_deprecated_string("pledge"sv).value_or("");
process.veil = process_object.get_deprecated_string("veil"sv).value_or("");
process.creation_time = UnixDateTime::from_nanoseconds_since_epoch(process_object.get_i64("creation_time"sv).value_or(0));
process.amount_virtual = process_object.get_u32("amount_virtual"sv).value_or(0);
process.amount_resident = process_object.get_u32("amount_resident"sv).value_or(0);
process.amount_shared = process_object.get_u32("amount_shared"sv).value_or(0);

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/Time.h>
#include <AK/Vector.h>
#include <unistd.h>
@ -49,6 +50,7 @@ struct ProcessStatistics {
DeprecatedString tty;
DeprecatedString pledge;
DeprecatedString veil;
UnixDateTime creation_time;
size_t amount_virtual;
size_t amount_resident;
size_t amount_shared;