summaryrefslogtreecommitdiff
path: root/src/user/lib/assert.c
diff options
context:
space:
mode:
authordzwdz2022-08-06 23:53:42 +0200
committerdzwdz2022-08-06 23:53:42 +0200
commit809f9a9899b219e33ec839b3f9bee644fcfecacc (patch)
tree5a4f4149859d5e834b5fe73b52a5e95e7e2d749b /src/user/lib/assert.c
parente86d720f6481e83ff555989006b7f62433318f57 (diff)
shared assert.h
Diffstat (limited to 'src/user/lib/assert.c')
-rw-r--r--src/user/lib/assert.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/user/lib/assert.c b/src/user/lib/assert.c
new file mode 100644
index 0000000..f42d696
--- /dev/null
+++ b/src/user/lib/assert.c
@@ -0,0 +1,8 @@
+#include <assert.h>
+#include <camellia/syscalls.h>
+#include <stdio.h>
+
+_Noreturn void __badassert(const char *func, const char *file, int line) {
+ fprintf(stderr, "assertion failure %s:%s:%u\n", file, func, line);
+ _syscall_exit(1);
+}