1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:15:10 +00:00

Kernel: SharedMemory should implement mmap().

This commit is contained in:
Andreas Kling 2019-05-18 04:17:53 +02:00
parent 237628a7a6
commit a4e48dce77
3 changed files with 8 additions and 6 deletions

View file

@ -88,3 +88,10 @@ int SharedMemory::write(FileDescriptor&, const byte* data, int data_size)
// FIXME: Implement.
ASSERT_NOT_REACHED();
}
KResultOr<Region*> SharedMemory::mmap(Process& process, LinearAddress laddr, size_t offset, size_t size)
{
if (!vmo())
return KResult(-ENODEV);
return process.allocate_region_with_vmo(laddr, size, *vmo(), offset, name(), true, true);
}