]> granicus.if.org Git - postgresql/commitdiff
Provide MAP_FAILED if sys/mman.h doesn't.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 28 Jun 2012 18:18:31 +0000 (14:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 28 Jun 2012 18:19:20 +0000 (14:19 -0400)
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.

src/backend/port/sysv_shmem.c

index 20f31ed218d7e6f9617da3b4cc3d8d465d8c3e5d..8f1da7a7ef4310225972ad53c5e29debd0020965 100644 (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;