This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6af64936925ee20ab2b08d389ee4447491c54433
Author: v-liuchenxu3 <[email protected]>
AuthorDate: Thu Nov 12 23:15:52 2026 +0800

    Documentation/tmpfs: describe timestamp support
    
    Describe which operations update the tmpfs access, modification and status 
change times.
    
    Signed-off-by: v-liuchenxu3 <[email protected]>
---
 Documentation/os/filesystem/tmpfs.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Documentation/os/filesystem/tmpfs.rst 
b/Documentation/os/filesystem/tmpfs.rst
index c6f146e9ace..b40e31d81b9 100644
--- a/Documentation/os/filesystem/tmpfs.rst
+++ b/Documentation/os/filesystem/tmpfs.rst
@@ -21,3 +21,21 @@ implements the optional ``mountpt_operations.permission`` 
hook.
 
 Access into the mount from the pseudoFS is gated by the VFS (parent and
 mountpoint ``X_OK``).  See :ref:`file-permission`.
+
+Timestamps
+==========
+
+Every tmpfs file and directory keeps ``st_atime``, ``st_mtime`` and
+``st_ctime``.  They are kept in RAM only and are lost when the volume is
+unmounted.
+
+- ``read()`` updates ``st_atime`` unless the file is opened with
+  ``O_NOATIME``.  ``mmap()`` also updates it, because tmpfs cannot trap the
+  first access to the mapping.
+- ``write()``, ``ftruncate()``, ``open()`` with ``O_TRUNC`` and ``msync()``
+  of a shared mapping update ``st_mtime`` and ``st_ctime``.
+- Creating, removing or renaming an entry updates ``st_mtime`` and
+  ``st_ctime`` of the directories involved, and ``st_ctime`` of a renamed
+  object.
+- ``utimensat()`` and ``futimens()`` set ``st_atime`` and ``st_mtime``.  Any
+  change of the times, mode or owner updates ``st_ctime``.

Reply via email to