mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
This is significantly simpler than parsing JSON and using the cpuinfo array length. This also has the side effect of making that command work on AArch64 and RISC-V, since ProcessorInfo is not implemented on those architectures yet.
20 lines
382 B
C++
20 lines
382 B
C++
/*
|
|
* Copyright (c) 2021, Peter Elliott <pelliott@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/JsonObject.h>
|
|
#include <LibCore/File.h>
|
|
#include <LibCore/System.h>
|
|
#include <LibMain/Main.h>
|
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
|
{
|
|
TRY(Core::System::pledge("stdio"));
|
|
|
|
outln("{}", Core::System::hardware_concurrency());
|
|
|
|
return 0;
|
|
}
|