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 <waddlesplash@gmail.com>
This commit is contained in:
Augustin Cavalier 2020-12-07 20:31:01 -05:00 committed by waddlesplash
parent 369abf3be4
commit 6f243905bf

View File

@ -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;