/* * Copyright (c) 2021, Peter Elliott * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio rpath")); auto file = TRY(Core::File::open("/sys/kernel/cpuinfo", Core::OpenMode::ReadOnly)); auto buffer = file->read_all(); auto json = TRY(JsonValue::from_string({ buffer })); auto const& cpuinfo_array = json.as_array(); outln("{}", cpuinfo_array.size()); return 0; }