Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: pws-19: mapfile bit that just sort of disappeared



Peter Stephenson wrote:
> By the way, it looks like mapfile using mmap() doesn't write the file
> properly on HPUX, probably the file doesn't get extended properly first.
> I'll have to look at that.

No real wonder.  This was there at some stage, though.

--- Src/Modules/mapfile.c.ms	Sat May 22 17:05:15 1999
+++ Src/Modules/mapfile.c	Tue May 25 13:40:47 1999
@@ -143,6 +143,7 @@
 	 */
 	ftruncate(fd, len);
 	memcpy(mmptr, value, len);
+	msync(mmptr, len, MS_SYNC);
 	/*
 	 * Then we need to truncate again, since mmap() always maps complete
 	 * pages.  Honestly, I tried it without, and you need both.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author