Patch #2111: Avoid mmap segfault when modifying a PROT_READ block.
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 091ecd6..3565ab6 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -881,6 +881,10 @@
 				    "mmap invalid access parameter.");
 	}
 
+    if (prot == PROT_READ) {
+        access = ACCESS_READ;
+    }
+
 #ifdef HAVE_FSTAT
 #  ifdef __VMS
 	/* on OpenVMS we must ensure that all bytes are written to the file */