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.
This commit is contained in:
Andreas Kling 2020-02-28 20:47:27 +01:00
commit 8fbdda5a2d
Notes: sideshowbarker 2024-07-19 08:59:02 +09:00
11 changed files with 45 additions and 31 deletions

View file

@ -109,7 +109,7 @@ public:
Custody* custody() { return m_custody.ptr(); }
const Custody* custody() const { return m_custody.ptr(); }
KResultOr<Region*> mmap(Process&, VirtualAddress, size_t offset, size_t, int prot);
KResultOr<Region*> mmap(Process&, VirtualAddress, size_t offset, size_t, int prot, bool shared);
bool is_blocking() const { return m_is_blocking; }
void set_blocking(bool b) { m_is_blocking = b; }