mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 12:38:51 +01:00
kernel/vm: Distinguish reserved areas from non-existent areas in vm_area_for.
RESERVED_AREA_ID == -1, so previously they weren't distinguishable. Now we return a different error code for an address that's in a reserved area.
This commit is contained in:
parent
c125a32508
commit
e0f5c2e5cd
@ -3467,6 +3467,9 @@ vm_area_for(addr_t address, bool kernel)
|
||||
&& (area->protection & (B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA)) == 0)
|
||||
return B_ERROR;
|
||||
|
||||
if (area->id == RESERVED_AREA_ID)
|
||||
return EADDRINUSE;
|
||||
|
||||
return area->id;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user