mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 15:58:56 +00:00
Applets: Use new global variables at /sys/kernel/ directory
This commit is contained in:
parent
ec96aee8e3
commit
6e508573a0
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/supercomputer7
Commit: 6e508573a0
Pull-request: https://github.com/SerenityOS/serenity/pull/15593
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
3 changed files with 11 additions and 11 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue