From 4eb967b5ebd5ca7a00049c7f958011e54b975040 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 14 Jul 2020 16:41:59 -0400 Subject: 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. --- Kernel/Arch/i386/CPU.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Kernel/Arch/i386') 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 static inline IterationDecision for_each(Callback callback) { -- cgit v1.2.3