diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-18 04:17:53 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-18 04:17:53 +0200 |
commit | a4e48dce77ba883c7260a7579f3ec53ba989b1f4 (patch) | |
tree | 3eb1e448f93a67cb032ff2457e44a919fb3aa455 /Kernel/SharedMemory.cpp | |
parent | 237628a7a602d1719b2fdfee342010518b3e7096 (diff) | |
download | serenity-a4e48dce77ba883c7260a7579f3ec53ba989b1f4.zip |
Kernel: SharedMemory should implement mmap().
Diffstat (limited to 'Kernel/SharedMemory.cpp')
-rw-r--r-- | Kernel/SharedMemory.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/SharedMemory.cpp b/Kernel/SharedMemory.cpp index d489891512..b371566828 100644 --- a/Kernel/SharedMemory.cpp +++ b/Kernel/SharedMemory.cpp @@ -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); +} |