make_objcode_by_mmap uses MAP_PRIVATE, not MAP_SHARED
authorAndy Wingo <wingo@pobox.com>
Fri, 1 Apr 2011 09:23:12 +0000 (11:23 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 1 Apr 2011 09:23:12 +0000 (11:23 +0200)
* libguile/objcodes.c (make_objcode_by_mmap): MAP_PRIVATE, not
  MAP_SHARED -- we don't need to update the underlying file, nor do we
  need to see updates.

libguile/objcodes.c

index f4e20f8..e91e265 100644 (file)
@@ -70,7 +70,7 @@ make_objcode_by_mmap (int fd)
     scm_misc_error (FUNC_NAME, "object file too small (~a bytes)",
                    scm_list_1 (SCM_I_MAKINUM (st.st_size)));
 
-  addr = mmap (0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
+  addr = mmap (0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
   if (addr == MAP_FAILED)
     {
       (void) close (fd);