summaryrefslogtreecommitdiff
path: root/src/user/knob/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/knob/panic.c')
-rw-r--r--src/user/knob/panic.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/user/knob/panic.c b/src/user/knob/panic.c
new file mode 100644
index 0000000..1ff663c
--- /dev/null
+++ b/src/user/knob/panic.c
@@ -0,0 +1,12 @@
+#include <knob/format.h>
+
+#include <pland/syscall.h>
+#include <pland/pcrt.h>
+
+#include <stdint.h>
+
+__attribute__ ((noreturn))
+void panic(const char *filename, uint32_t line, const char *message) {
+ _system_log(format("panic in %s on line %u: %s", filename, line, message));
+ __pcrt_quit();
+} \ No newline at end of file