From af6358e1e1e3f834d5df5269f37bd1a016da2b8e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 17 Nov 2021 19:35:13 +0100 Subject: [PATCH] Kernel: Allow mmap() with PROT_WRITE+MAP_SHARED Now that we have a way to flush changes back to disk, let's allow this type of mapping. --- Kernel/FileSystem/InodeFile.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Kernel/FileSystem/InodeFile.cpp b/Kernel/FileSystem/InodeFile.cpp index 7c5c93c728..ad252f1d24 100644 --- a/Kernel/FileSystem/InodeFile.cpp +++ b/Kernel/FileSystem/InodeFile.cpp @@ -83,11 +83,6 @@ ErrorOr InodeFile::ioctl(OpenFileDescription& description, unsigned reques ErrorOr InodeFile::mmap(Process& process, OpenFileDescription& description, Memory::VirtualRange const& range, u64 offset, int prot, bool shared) { - // FIXME: Support writing changes made to shared file mappings back to disk. - // Some ports behave incorrectly if we silently discard writes to memory-mapped files, so let's not lie about what we can do. - if (shared && (prot & PROT_WRITE)) - return ENOTSUP; - // FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec. RefPtr vmobject; if (shared)