Added support for protection flag B_USER_CLONEABLE_AREA.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-01-25 22:13:10 +00:00
parent 6e9582baf1
commit 6e53f60e2c
+4 -2
View File
@@ -1127,8 +1127,10 @@ vm_clone_area(aspace_id aid, const char *name, void **address, uint32 addressSpe
return ERR_VM_INVALID_REGION;
}
if (sourceArea->aspace == kernel_aspace && aspace != kernel_aspace) {
// kernel areas must not be cloned in userland
if (sourceArea->aspace == kernel_aspace && aspace != kernel_aspace
&& !(sourceArea->protection & B_USER_CLONEABLE_AREA)) {
// kernel areas must not be cloned in userland, unless explicitly
// declared user-cloneable upon construction
status = B_NOT_ALLOWED;
} else {
vm_cache_acquire_ref(sourceArea->cache_ref, true);