svn commit: r213886 - stable/8/sys/vm
Alan Cox
alc at FreeBSD.org
Fri Oct 15 02:58:50 UTC 2010
Author: alc
Date: Fri Oct 15 02:58:49 2010
New Revision: 213886
URL: http://svn.freebsd.org/changeset/base/213886
Log:
MFC r212873
Allow a POSIX shared memory object that is opened for read but not for
write to nonetheless be mapped PROT_WRITE and MAP_PRIVATE, i.e.,
copy-on-write.
PR: 150260
Modified:
stable/8/sys/vm/vm_mmap.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/vm/vm_mmap.c
==============================================================================
--- stable/8/sys/vm/vm_mmap.c Thu Oct 14 23:38:37 2010 (r213885)
+++ stable/8/sys/vm/vm_mmap.c Fri Oct 15 02:58:49 2010 (r213886)
@@ -1316,7 +1316,8 @@ vm_mmap_shm(struct thread *td, vm_size_t
{
int error;
- if ((*maxprotp & VM_PROT_WRITE) == 0 &&
+ if ((*flagsp & MAP_SHARED) != 0 &&
+ (*maxprotp & VM_PROT_WRITE) == 0 &&
(prot & PROT_WRITE) != 0)
return (EACCES);
#ifdef MAC
More information about the svn-src-all
mailing list