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.
This commit is contained in:
Itamar 2020-07-31 18:41:19 +03:00 committed by Andreas Kling
parent cf78c16afd
commit 5cd7159629
Notes: sideshowbarker 2024-07-19 04:26:29 +09:00
2 changed files with 4 additions and 0 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/Process.h> #include <Kernel/Process.h>
namespace Kernel { namespace Kernel {
@ -34,6 +35,8 @@ long Process::sys$sysconf(int name)
case _SC_NPROCESSORS_CONF: case _SC_NPROCESSORS_CONF:
case _SC_NPROCESSORS_ONLN: case _SC_NPROCESSORS_ONLN:
return Processor::processor_count(); return Processor::processor_count();
case _SC_PAGESIZE:
return PAGE_SIZE;
default: default:
return -EINVAL; return -EINVAL;
} }

View file

@ -58,6 +58,7 @@
enum { enum {
_SC_NPROCESSORS_CONF, _SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN, _SC_NPROCESSORS_ONLN,
_SC_PAGESIZE,
}; };
#define PERF_EVENT_MALLOC 1 #define PERF_EVENT_MALLOC 1