Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c1494b7

Browse files
committed
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.
1 parent 8f85667 commit c1494b7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/port/sysv_shmem.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ typedef int IpcMemoryId; /* shared memory ID returned by shmget(2) */
5656

5757
#define PG_MMAP_FLAGS (MAP_SHARED|MAP_ANONYMOUS|MAP_HASSEMAPHORE)
5858

59+
/* Some really old systems don't define MAP_FAILED. */
60+
#ifndef MAP_FAILED
61+
#define MAP_FAILED ((void *) -1)
62+
#endif
63+
64+
5965
unsigned long UsedShmemSegID = 0;
6066
void *UsedShmemSegAddr = NULL;
6167
static Size AnonymousShmemSize;

0 commit comments

Comments
 (0)