aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd/src/cstdlib.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-10-28 18:31:39 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-10-28 18:31:39 +0100
commit12dedc7e2e51390fdf2caec3700e75db19be1cd4 (patch)
tree3dffc472cdc680417adf400026d626407d05dd04 /libs/kstd/src/cstdlib.cpp
parent9535226376ea812007fbe8a2aaf6cf3ccb77c263 (diff)
downloadteachos-12dedc7e2e51390fdf2caec3700e75db19be1cd4.tar.xz
teachos-12dedc7e2e51390fdf2caec3700e75db19be1cd4.zip
kstd: don't rely on newlib
Diffstat (limited to 'libs/kstd/src/cstdlib.cpp')
-rw-r--r--libs/kstd/src/cstdlib.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/kstd/src/cstdlib.cpp b/libs/kstd/src/cstdlib.cpp
new file mode 100644
index 0000000..8fb5f63
--- /dev/null
+++ b/libs/kstd/src/cstdlib.cpp
@@ -0,0 +1,18 @@
+#include "kstd/bits/os.hpp"
+
+namespace kstd
+{
+
+ extern "C"
+ {
+ [[noreturn]] auto abort() -> void
+ {
+ if (!kstd::os::abort())
+ {
+ os::panic("System abort handler returned.");
+ }
+ __builtin_trap();
+ }
+ }
+
+} // namespace kstd \ No newline at end of file