summaryrefslogtreecommitdiff
path: root/sources/plat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sources/plat.c')
-rw-r--r--sources/plat.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sources/plat.c b/sources/plat.c
new file mode 100644
index 0000000..afa0f21
--- /dev/null
+++ b/sources/plat.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2025 dwlr <dweller@cabin.digital>
+ *
+ * BSD 3-Clause License (BSD-3-Clause)
+ * See LICENSE for details
+ */
+
+
+ssize cpu_count(void)
+{
+ static ssize cpus = 0;
+ if(!cpus) cpus = sysconf(_SC_NPROCESSORS_ONLN);
+
+ return cpus;
+}
+
+ssize mm_pagesize(void)
+{
+ static ssize page_size = 0;
+ if(!page_size) page_size = sysconf(_SC_PAGE_SIZE);
+
+ return page_size;
+}
+