Provide MAP_FAILED if sys/mman.h doesn't.

On old HPUX this has to be #defined to -1.  It might be that other values
are required on other dinosaur systems, but we'll worry about that when
and if we get reports.
This commit is contained in:
Tom Lane 2012-06-28 14:18:31 -04:00
parent 8f85667a86
commit c1494b7330

View File

@ -56,6 +56,12 @@ typedef int IpcMemoryId; /* shared memory ID returned by shmget(2) */
#define PG_MMAP_FLAGS (MAP_SHARED|MAP_ANONYMOUS|MAP_HASSEMAPHORE)
/* Some really old systems don't define MAP_FAILED. */
#ifndef MAP_FAILED
#define MAP_FAILED ((void *) -1)
#endif
unsigned long UsedShmemSegID = 0;
void *UsedShmemSegAddr = NULL;
static Size AnonymousShmemSize;