summaryrefslogtreecommitdiffstats
path: root/usr/klibc/assert.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/assert.c')
-rw-r--r--usr/klibc/assert.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr/klibc/assert.c b/usr/klibc/assert.c
new file mode 100644
index 0000000..cca4129
--- /dev/null
+++ b/usr/klibc/assert.c
@@ -0,0 +1,14 @@
+/*
+ * assert.c
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+#include <klibc/compiler.h>
+
+__noreturn __assert_fail(const char *expr, const char *file, unsigned int line)
+{
+ printf("Assertion %s failed, file %s, line %u\n", expr, file, line);
+ abort();
+}