mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 23:32:17 -08:00
Failure of mmap() is signaled by MAP_FAIL (Posix), but in some platforms it is not defined and specified as -1
This commit is contained in:
parent
92c4454ece
commit
a40ed5054c
1 changed files with 5 additions and 2 deletions
|
|
@ -34,6 +34,9 @@
|
|||
#endif
|
||||
#ifdef ECL_USE_MPROTECT
|
||||
# include <sys/mman.h>
|
||||
# ifndef MAP_FAIL
|
||||
# define MAP_FAIL -1
|
||||
# endif
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -212,8 +215,8 @@ _ecl_alloc_env()
|
|||
cl_env_ptr output;
|
||||
#if defined(ECL_USE_MPROTECT)
|
||||
output = mmap(0, sizeof(*output), PROT_READ | PROT_WRITE,
|
||||
MAP_ANON | MAP_PRIVATE, 0, 0);
|
||||
if (output < 0)
|
||||
MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
if (output == MAP_FAIL)
|
||||
ecl_internal_error("Unable to allocate environment structure.");
|
||||
#else
|
||||
output = ecl_alloc(sizeof(*output));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue