summaryrefslogtreecommitdiff
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index c2c723c302..56033e8d4e 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -897,6 +897,10 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
}
#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");