Kernel: Allow mmap() with a size that's not a multiple of page size.

We just round it up to the next multiple of page size anyway.
This commit is contained in:
Andreas Kling 2019-02-09 08:44:46 +01:00
parent fa241747af
commit c4e984ca49
Notes: sideshowbarker 2024-07-19 15:49:03 +09:00

View file

@ -162,7 +162,7 @@ void* Process::sys$mmap(const Syscall::SC_mmap_params* params)
off_t offset = params->offset;
if (size == 0)
return (void*)-EINVAL;
if ((dword)addr & ~PAGE_MASK || size & ~PAGE_MASK)
if ((dword)addr & ~PAGE_MASK)
return (void*)-EINVAL;
if (flags & MAP_ANONYMOUS) {
// FIXME: Implement mapping at a client-specified address. Most of the support is already in plcae.