On Tue, Jul 23, 2019 at 11:49:13AM +0200, Paolo Bonzini wrote: > On 23/07/19 11:42, Stefano Garzarella wrote: > > "If writable is TRUE, the mapped buffer may be modified, otherwise it is an > > error to modify the mapped buffer. Modifications to the buffer are not > > visible > > to other processes mapping the same file, and are not written back to the > > file." > > > > I don't know what "error" means, but reading the second part I thought > > the changes in that case were only visible at the current process. > > My reading would be that the second part applies to the writable==TRUE > case. In fact, the glib source code agrees: > > file->contents = (gchar *) mmap (NULL, file->length, > writable ? PROT_READ|PROT_WRITE : PROT_READ, > MAP_PRIVATE, fd, 0); > > meaning that we could after all just use writable == true.
Thanks for checking! I'll use writable == true in the v2! Stefano