hardened_malloc/util.c

15 lines
321 B
C
Raw Normal View History

2018-08-22 00:53:22 +05:30
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "util.h"
COLD noreturn void fatal_error(const char *s) {
2018-10-04 01:52:28 +05:30
const char *prefix = "fatal allocator error: ";
write(STDERR_FILENO, prefix, strlen(prefix));
2018-08-22 00:53:22 +05:30
write(STDERR_FILENO, s, strlen(s));
write(STDERR_FILENO, "\n", 1);
abort();
}