/* We already checked this is a memfd... */
g_assert_se (fstat (fd, &buf) == 0);
/* We already checked this is a memfd... */
g_assert_se (fstat (fd, &buf) == 0);
- bytes->data = mmap (NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+ bytes->data = mmap (NULL, buf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (bytes->data == MAP_FAILED)
/* this is similar to malloc() failing, so do the same... */
g_error ("mmap() on memfd failed: %s\n", g_strerror (errno));
if (bytes->data == MAP_FAILED)
/* this is similar to malloc() failing, so do the same... */
g_error ("mmap() on memfd failed: %s\n", g_strerror (errno));