summaryrefslogtreecommitdiff
path: root/Kernel/Arch/i386
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-07-14 16:41:59 -0400
committerAndreas Kling <kling@serenityos.org>2020-07-15 00:07:20 +0200
commit4eb967b5ebd5ca7a00049c7f958011e54b975040 (patch)
tree25da6871473ae3484cf3c1c894b287b8be42626c /Kernel/Arch/i386
parent782cd93c012bcad8a96dfd67aeb782ef49d380f9 (diff)
downloadserenity-4eb967b5ebd5ca7a00049c7f958011e54b975040.zip
LibC+Kernel: Start implementing sysconf
For now, only the non-standard _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN are implemented. Use them to make ninja pick a better default -j value. While here, make the ninja package script not fail if no other port has been built yet.
Diffstat (limited to 'Kernel/Arch/i386')
-rw-r--r--Kernel/Arch/i386/CPU.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Arch/i386/CPU.h b/Kernel/Arch/i386/CPU.h
index 95f8980a50..de90cd6dc9 100644
--- a/Kernel/Arch/i386/CPU.h
+++ b/Kernel/Arch/i386/CPU.h
@@ -744,6 +744,8 @@ public:
static Processor& by_id(u32 cpu);
+ static size_t processor_count() { return processors().size(); }
+
template<typename Callback>
static inline IterationDecision for_each(Callback callback)
{