summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/FileDescription.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-28 20:47:27 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-28 23:25:00 +0100
commit8fbdda5a2dae61d336e5fabcc6b6adf5c8efa308 (patch)
tree3da9f6a432aa9be2fbdced965d19599366a19d48 /Kernel/FileSystem/FileDescription.cpp
parentaa1e209845b496e60b31ad74fed30623b3e9ad39 (diff)
downloadserenity-8fbdda5a2dae61d336e5fabcc6b6adf5c8efa308.zip
Kernel: Implement basic support for sys$mmap() with MAP_PRIVATE
You can now mmap a file as private and writable, and the changes you make will only be visible to you. This works because internally a MAP_PRIVATE region is backed by a unique PrivateInodeVMObject instead of using the globally shared SharedInodeVMObject like we always did before. :^) Fixes #1045.
Diffstat (limited to 'Kernel/FileSystem/FileDescription.cpp')
-rw-r--r--Kernel/FileSystem/FileDescription.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/FileDescription.cpp b/Kernel/FileSystem/FileDescription.cpp
index 1bd1659563..f159f30d92 100644
--- a/Kernel/FileSystem/FileDescription.cpp
+++ b/Kernel/FileSystem/FileDescription.cpp
@@ -281,10 +281,10 @@ InodeMetadata FileDescription::metadata() const
return {};
}
-KResultOr<Region*> FileDescription::mmap(Process& process, VirtualAddress vaddr, size_t offset, size_t size, int prot)
+KResultOr<Region*> FileDescription::mmap(Process& process, VirtualAddress vaddr, size_t offset, size_t size, int prot, bool shared)
{
LOCKER(m_lock);
- return m_file->mmap(process, *this, vaddr, offset, size, prot);
+ return m_file->mmap(process, *this, vaddr, offset, size, prot, shared);
}
KResult FileDescription::truncate(u64 length)