summaryrefslogtreecommitdiff
path: root/yjit_asm.c
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-09-14 10:31:34 +0200
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:40 -0400
commit217f7cb16fe466b8be3cdb969655b4512d5e95fa (patch)
treeca94eb2272b0aadbe71f41baedf38c0d536e13d8 /yjit_asm.c
parent96fd8afbf4d93b6831ca119fd8c1f07dfa9abd07 (diff)
Include errno message in mmap failure output
It might help figure out why it is failing.
Diffstat (limited to 'yjit_asm.c')
-rw-r--r--yjit_asm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/yjit_asm.c b/yjit_asm.c
index 31e1528ff0..4a296e314c 100644
--- a/yjit_asm.c
+++ b/yjit_asm.c
@@ -7,6 +7,7 @@
#include <stdarg.h>
#include <stdint.h>
#include <assert.h>
+#include <errno.h>
// For mmapp(), sysconf()
#ifndef _WIN32
@@ -203,7 +204,7 @@ uint8_t* alloc_exec_mem(uint32_t mem_size)
// Check that the memory mapping was successful
if (mem_block == MAP_FAILED) {
- fprintf(stderr, "mmap call failed\n");
+ perror("mmap call failed");
exit(-1);
}