1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Include errno message in mmap failure output

It might help figure out why it is failing.
This commit is contained in:
Jean Boussier 2021-09-14 10:31:34 +02:00 committed by Alan Wu
parent 96fd8afbf4
commit 217f7cb16f

View file

@ -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);
}