diff options
author | Nico Weber <thakis@chromium.org> | 2020-07-14 16:41:59 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-15 00:07:20 +0200 |
commit | 4eb967b5ebd5ca7a00049c7f958011e54b975040 (patch) | |
tree | 25da6871473ae3484cf3c1c894b287b8be42626c /Kernel/Process.cpp | |
parent | 782cd93c012bcad8a96dfd67aeb782ef49d380f9 (diff) | |
download | serenity-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/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 3bb727452e..a051e8145b 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -5308,4 +5308,15 @@ int Process::sys$recvfd(int sockfd) m_fds[new_fd].set(*received_descriptor_or_error.value(), 0); return new_fd; } + +long Process::sys$sysconf(int name) +{ + switch (name) { + case _SC_NPROCESSORS_CONF: + case _SC_NPROCESSORS_ONLN: + return Processor::processor_count(); + default: + return -EINVAL; + } +} } |