This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 5aa248c502d8443f4d776b137f755850d6d7af32 Author: Marco Casaroli <[email protected]> AuthorDate: Sat Oct 17 19:34:41 2026 +0200 Documentation: Describe the write-back of shared rammap mappings. With CONFIG_FS_RAMMAP, the changes to a shared, writable mapping now reach the file on msync() and on munmap(). The two descriptions of rammap still said that the file never changes. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/os/filesystem/mmap.rst | 6 ++++-- Documentation/reference/user/10_filesystem.rst | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/os/filesystem/mmap.rst b/Documentation/os/filesystem/mmap.rst index a7c69185b3f..cd97605ea91 100644 --- a/Documentation/os/filesystem/mmap.rst +++ b/Documentation/os/filesystem/mmap.rst @@ -58,8 +58,10 @@ conditions where mmap() can be supported: in the size of files that may be memory mapped (especially on MCUs with no significant RAM resources). - c. All mapped files are read-only. You can write to the in-memory image, - but the file contents will not change. + c. Writes to a private mapping (MAP_PRIVATE) change only the in-memory + image, never the file. Writes to a shared, writable mapping + (MAP_SHARED with PROT_WRITE) reach the file when msync() is called + and when munmap() removes the mapping. d. There are no access privileges. diff --git a/Documentation/reference/user/10_filesystem.rst b/Documentation/reference/user/10_filesystem.rst index 4e1aef5419e..58ddc19a888 100644 --- a/Documentation/reference/user/10_filesystem.rst +++ b/Documentation/reference/user/10_filesystem.rst @@ -506,8 +506,10 @@ are two conditions where ``mmap()`` can be supported: there are limitations in the size of files that may be memory mapped (especially on MCUs with no significant RAM resources). - c. All mapped files are read-only. You can write to the in-memory - image, but the file contents will not change. + c. Writes to a private mapping (``MAP_PRIVATE``) change only the + in-memory image, never the file. Writes to a shared, writable + mapping (``MAP_SHARED`` with ``PROT_WRITE``) reach the file when + ``msync()`` is called and when ``munmap()`` removes the mapping. d. There are no access privileges.
