summaryrefslogtreecommitdiff
path: root/prb_linux.h
diff options
context:
space:
mode:
Diffstat (limited to 'prb_linux.h')
-rw-r--r--prb_linux.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/prb_linux.h b/prb_linux.h
index 3acc229..9a6ba90 100644
--- a/prb_linux.h
+++ b/prb_linux.h
@@ -17,6 +17,17 @@ void sys_free(void *memory, u64 length)
munmap(memory, length);
}
+void die(const char *error_string, ...)
+{
+ va_list args;
+ va_start(args, error_string);
+ fprintf(stderr, "error: ");
+ vfprintf(stderr, error_string, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+ _exit(1);
+}
+
u64 sys_read_file(arena_t *arena, char **buffer, const char *filename)
{
FILE *file = fopen(filename, "rb");