Skip to content

Commit 2e4b89c

Browse files
authored
Merge pull request #218 from Shopify/show-error-on-mmap-failure
Include errno message in mmap failure output
2 parents 4959076 + 5cb5609 commit 2e4b89c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

yjit_asm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdarg.h>
88
#include <stdint.h>
99
#include <assert.h>
10+
#include <errno.h>
1011

1112
// For mmapp(), sysconf()
1213
#ifndef _WIN32
@@ -203,7 +204,7 @@ uint8_t* alloc_exec_mem(uint32_t mem_size)
203204

204205
// Check that the memory mapping was successful
205206
if (mem_block == MAP_FAILED) {
206-
fprintf(stderr, "mmap call failed\n");
207+
perror("mmap call failed");
207208
exit(-1);
208209
}
209210

0 commit comments

Comments
 (0)