mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Kernel: Make sys$mmap() round requested VM size to page size multiple
This fixes an issue where File::mmap() overrides would fail because they were expecting to be called with a size evenly divisible by PAGE_SIZE.
This commit is contained in:
parent
e465b59ca4
commit
9b9b05eabf
Notes:
sideshowbarker
2024-07-17 14:24:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9b9b05eabf
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ ErrorOr<FlatPtr> Process::sys$mmap(Userspace<Syscall::SC_mmap_params const*> use
|
|||
if (map_fixed)
|
||||
TRY(address_space().unmap_mmap_range(VirtualAddress(addr), size));
|
||||
|
||||
Memory::VirtualRange requested_range { VirtualAddress { addr }, size };
|
||||
Memory::VirtualRange requested_range { VirtualAddress { addr }, rounded_size };
|
||||
if (addr && !(map_fixed || map_fixed_noreplace)) {
|
||||
// If there's an address but MAP_FIXED wasn't specified, the address is just a hint.
|
||||
requested_range = { {}, 0 };
|
||||
|
|
Loading…
Add table
Reference in a new issue