Patch #708495: Port more stuff to OpenVMS.
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index c2c723c..56033e8 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -897,6 +897,10 @@
 	}
 
 #ifdef HAVE_FSTAT
+#  ifdef __VMS
+	/* on OpenVMS we must ensure that all bytes are written to the file */
+	fsync(fd);
+#  endif
 	if (fstat(fd, &st) == 0 && (size_t)map_size > st.st_size) {
 		PyErr_SetString(PyExc_ValueError, 
 				"mmap length is greater than file size");