Kernel: SharedMemory should implement mmap().

This commit is contained in:
Andreas Kling 2019-05-18 04:17:53 +02:00
parent 237628a7a6
commit a4e48dce77
Notes: sideshowbarker 2024-07-19 14:02:22 +09:00
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);
}