mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-16 21:04:20 +00:00
UserspaceEmulator: Fail with EINVAL for mmap with size 0
This is the behaviour specified by POSIX and also the behaviour of the real kernel, so let's follow that while emulating.
This commit is contained in:
parent
89502fc329
commit
1b8012e5c7
|
@ -868,6 +868,9 @@ u32 Emulator::virt$mmap(u32 params_addr)
|
|||
mmu().copy_from_vm(¶ms, params_addr, sizeof(params));
|
||||
params.alignment = params.alignment ? params.alignment : PAGE_SIZE;
|
||||
|
||||
if (params.size == 0)
|
||||
return -EINVAL;
|
||||
|
||||
u32 requested_size = round_up_to_power_of_two(params.size, PAGE_SIZE);
|
||||
FlatPtr final_address;
|
||||
|
||||
|
|
Loading…
Reference in a new issue