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

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

This commit is contained in:
Liav A 2022-10-14 21:54:16 +03:00 committed by Andrew Kaster
parent ec96aee8e3
commit 6e508573a0
3 changed files with 11 additions and 11 deletions

View file

@ -162,7 +162,7 @@ private:
total = 0;
idle = 0;
auto json = get_data_as_json(m_proc_stat, "/proc/stat"sv);
auto json = get_data_as_json(m_proc_stat, "/sys/kernel/stats"sv);
if (json.is_error())
return false;
@ -174,7 +174,7 @@ private:
bool get_memory_usage(u64& allocated, u64& available)
{
auto json = get_data_as_json(m_proc_mem, "/proc/memstat"sv);
auto json = get_data_as_json(m_proc_mem, "/sys/kernel/memstat"sv);
if (json.is_error())
return false;
@ -196,7 +196,7 @@ private:
{
tx = rx = link_speed = 0;
auto json = get_data_as_json(m_proc_net, "/proc/net/adapters"sv);
auto json = get_data_as_json(m_proc_net, "/sys/kernel/net/adapters"sv);
if (json.is_error())
return false;
@ -291,9 +291,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(create_applet(GraphType::Network, network));
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/proc/stat", "r"));
TRY(Core::System::unveil("/proc/memstat", "r"));
TRY(Core::System::unveil("/proc/net/adapters", "r"));
TRY(Core::System::unveil("/sys/kernel/stats", "r"));
TRY(Core::System::unveil("/sys/kernel/memstat", "r"));
TRY(Core::System::unveil("/sys/kernel/net/adapters", "r"));
TRY(Core::System::unveil("/bin/SystemMonitor", "x"));
TRY(Core::System::unveil(nullptr, nullptr));