From 6f243905bf192369b15cacfb54f19d79fb1756a5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 7 Dec 2020 20:31:01 -0500 Subject: [PATCH] kernel: Allow usage of magic team constants in create_area_etc. All other functions that support these handle them specifically, so vm_create_anonymous_area must do so as well. Change-Id: I7233770926b718936baeff10ef73668ac15c5201 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3477 Reviewed-by: waddlesplash --- src/system/kernel/vm/vm.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 849e56a98c..4bdea39e3e 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -1347,6 +1347,11 @@ vm_create_anonymous_area(team_id team, const char *name, addr_t size, if (!arch_vm_supports_protection(protection)) return B_NOT_SUPPORTED; + if (team == B_CURRENT_TEAM) + team = VMAddressSpace::CurrentID(); + if (team < 0) + return B_BAD_TEAM_ID; + if (isStack || (protection & B_OVERCOMMITTING_AREA) != 0) canOvercommit = true;