summaryrefslogtreecommitdiff
path: root/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'panic.c')
-rw-r--r--panic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/panic.c b/panic.c
new file mode 100644
index 0000000..ef4475e
--- /dev/null
+++ b/panic.c
@@ -0,0 +1,14 @@
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdnoreturn.h>
+
+
+noreturn void panic(char * fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vdprintf(2, fmt, args);
+ va_end(args);
+ exit(1);
+}