/* We immediately remap it to prevent an intervening mmap from */
/* accidentally grabbing the same address space. */
{
-# ifdef CYGWIN32
- /* Calling mmap() with the new protection flags on an */
- /* existing memory map with MAP_FIXED is broken on Cygwin. */
+# if defined(AIX) || defined(CYGWIN32)
+ /* On AIX, mmap(PROT_NONE) fails with ENOMEM unless the */
+ /* environment variable XPG_SUS_ENV is set to ON. */
+ /* On Cygwin, calling mmap() with the new protection flags on */
+ /* an existing memory map with MAP_FIXED is broken. */
/* However, calling mprotect() on the given address range */
/* with PROT_NONE seems to work fine. */
if (mprotect(start_addr, len, PROT_NONE))
# else
if (len != 0) {
/* Immediately remap as above. */
-# ifdef CYGWIN32
+# if defined(AIX) || defined(CYGWIN32)
if (mprotect(start_addr, len, PROT_NONE))
ABORT("mprotect(PROT_NONE) failed");
# else