mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
lsirq: Port to Core::Stream
This commit is contained in:
parent
2be7f9f42d
commit
9e4689f4c8
1 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/Stream.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
||||
|
@ -17,11 +17,11 @@ ErrorOr<int> serenity_main(Main::Arguments)
|
|||
TRY(Core::System::unveil("/sys/kernel/interrupts", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto proc_interrupts = TRY(Core::File::open("/sys/kernel/interrupts", Core::OpenMode::ReadOnly));
|
||||
auto proc_interrupts = TRY(Core::Stream::File::open("/sys/kernel/interrupts"sv, Core::Stream::OpenMode::Read));
|
||||
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
|
||||
auto file_contents = proc_interrupts->read_all();
|
||||
auto file_contents = TRY(proc_interrupts->read_all());
|
||||
auto json = TRY(JsonValue::from_string(file_contents));
|
||||
|
||||
auto cpu_count = json.as_array().at(0).as_object().get("per_cpu_call_counts"sv).as_array().size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue