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 3549d767e658c9cad93a4bace969b8bd09e5bb45
Author: Marco Casaroli <[email protected]>
AuthorDate: Wed Nov 11 06:12:13 2026 +0100

    Documentation: Describe the file serial numbers of procfs and st_dev.
    
    procfs.rst: each path of procfs has a file serial number, the same in
    stat(), fstat() and readdir().
    
    special_files_dev_num.rst said that NuttX cannot support st_dev.  The
    files of a mounted volume now have a device number; only the files of
    the pseudo-file system keep st_dev 0.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/os/filesystem/procfs.rst                | 9 +++++++++
 Documentation/os/filesystem/special_files_dev_num.rst | 8 +++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Documentation/os/filesystem/procfs.rst 
b/Documentation/os/filesystem/procfs.rst
index 9a914c68b94..0feeedd55f5 100644
--- a/Documentation/os/filesystem/procfs.rst
+++ b/Documentation/os/filesystem/procfs.rst
@@ -62,3 +62,12 @@ of ``<pid>``.  ``Gid:`` gives the real and the effective 
group ID::
 
 ``stat()`` of ``/proc/<pid>`` and of the files in it gives the effective
 user and group ID of the task group in ``st_uid`` and ``st_gid``.
+
+File serial numbers
+===================
+
+Each path of procfs has a file serial number: a hash of the path below
+the mount point.  ``stat()``, ``fstat()`` and ``readdir()`` give the same
+number for one path, in ``st_ino`` and ``d_ino``.  The number does not
+change while the path exists.  ``/proc/<pid>`` of a new task that gets an
+old PID has the number of the old ``/proc/<pid>``.
diff --git a/Documentation/os/filesystem/special_files_dev_num.rst 
b/Documentation/os/filesystem/special_files_dev_num.rst
index 2038e4e5b86..d1ac38d50a7 100644
--- a/Documentation/os/filesystem/special_files_dev_num.rst
+++ b/Documentation/os/filesystem/special_files_dev_num.rst
@@ -45,9 +45,11 @@ pseudo-file system? Reduce resource usage, reduced bring-up
 requirements. What are the disadvantages? In NuttX, special 
 files can only reside in the pseudo-file system.
 
-The only other consequence that I aware of is that NuttX cannot 
-support the POSIX requirement for the ``st_dev`` field in the 
-``struct stat`` structure.
+The only other consequence that I aware of is that the files of the
+pseudo-file system have no device number: ``stat()`` gives ``st_dev`` 0
+for them.  The files of a mounted volume get the device number that the
+file system gives, or else the file serial number of the mount point.  So
+``st_dev`` and ``st_ino`` tell the files of two volumes apart.
 
 
 Device Files and Device Numbers

Reply via email to