mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-30 13:19:02 +00:00
Kernel: Return EEXIST in VirtualRangeAllocator::try_allocate_specific()
This error only ever gets propagated to the userspace if MAP_FIXED_NOREPLACE is requested, as MAP_FIXED unmaps intersecting ranges beforehand, and non-fixed mmap() calls will just fall back to allocating anywhere. Linux specifies MAP_FIXED_NOREPLACE to return EEXIST when it can't allocate, we now match that behavior.
This commit is contained in:
parent
143dbba562
commit
4195a7ef4b
Notes:
sideshowbarker
2024-07-17 22:19:33 +09:00
Author: https://github.com/BertalanD
Commit: 4195a7ef4b
Pull-request: https://github.com/SerenityOS/serenity/pull/11369
1 changed files with 2 additions and 2 deletions
|
@ -146,9 +146,9 @@ ErrorOr<VirtualRange> VirtualRangeAllocator::try_allocate_specific(VirtualAddres
|
|||
SpinlockLocker lock(m_lock);
|
||||
auto available_range = m_available_ranges.find_largest_not_above(base.get());
|
||||
if (!available_range)
|
||||
return ENOMEM;
|
||||
return EEXIST;
|
||||
if (!available_range->contains(allocated_range))
|
||||
return ENOMEM;
|
||||
return EEXIST;
|
||||
if (*available_range == allocated_range) {
|
||||
m_available_ranges.remove(available_range->base().get());
|
||||
return allocated_range;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue