mmap: accept non-PROT_WRITE MAP_SHARED mappings

Currently we don't accept writable file mmap()s, as there is no
system in place to guarantee dirty buffers would make it back to
disk. But we can actually accept MAP_SHARED for PROT_READ mappings,
meaning the ranges aren't writable at all (and no private copy is
made as with MAP_PRIVATE), as it turns out a fairly large class of
usage.

	. fail writable MAP_SHARED mappings at runtime
	. reduces some minix-specific patches
	. lets binutils gold build on minix without further patching

Change-Id: If2896c0a555328ac5b324afa706063fc6d86519e
This commit is contained in:
Ben Gras
2014-03-17 15:53:28 +01:00
committed by Lionel Sambuc
parent 29dca95386
commit 0b79eac642
11 changed files with 21 additions and 46 deletions

View File

@@ -68,9 +68,7 @@ typedef __off_t off_t; /* file offset */
* Flags contain sharing type and options.
* Sharing types; choose one.
*/
#if !defined(__minix)
#define MAP_SHARED 0x0001 /* share changes */
#endif /* !defined(__minix) */
#define MAP_PRIVATE 0x0002 /* changes are private */
#ifdef _KERNEL