From 5cd7159629ee6a4053c376b5846be585d097b205 Mon Sep 17 00:00:00 2001 From: Itamar Date: Fri, 31 Jul 2020 18:41:19 +0300 Subject: [PATCH] Kernel: Add _SC_PAGESIZE to sysconf This unbreaks the gcc and binutils ports. Previously, when _SC_PAGESIZE was missing, these packages opted to use their own versions of getpagesize which made their build fail because of conflicting definitions of the function. --- Kernel/Syscalls/sysconf.cpp | 3 +++ Kernel/UnixTypes.h | 1 + 2 files changed, 4 insertions(+) diff --git a/Kernel/Syscalls/sysconf.cpp b/Kernel/Syscalls/sysconf.cpp index 769c3394df..5c25b41463 100644 --- a/Kernel/Syscalls/sysconf.cpp +++ b/Kernel/Syscalls/sysconf.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include namespace Kernel { @@ -34,6 +35,8 @@ long Process::sys$sysconf(int name) case _SC_NPROCESSORS_CONF: case _SC_NPROCESSORS_ONLN: return Processor::processor_count(); + case _SC_PAGESIZE: + return PAGE_SIZE; default: return -EINVAL; } diff --git a/Kernel/UnixTypes.h b/Kernel/UnixTypes.h index 9115c22daa..19a9f742f4 100644 --- a/Kernel/UnixTypes.h +++ b/Kernel/UnixTypes.h @@ -58,6 +58,7 @@ enum { _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, + _SC_PAGESIZE, }; #define PERF_EVENT_MALLOC 1