]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/readdir.3, man/man3type/stat.3type: Improve documentation about .d_ino and... ino
authorAlejandro Colomar <alx@kernel.org>
Wed, 28 May 2025 18:59:11 +0000 (20:59 +0200)
committerAlejandro Colomar <alx@kernel.org>
Mon, 30 Jun 2025 03:58:41 +0000 (05:58 +0200)
Suggested-by: Pali Rohár <pali@kernel.org>
Co-authored-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/readdir.3
man/man3type/stat.3type

index b9150160bc2cfa4017df6a88e9df8d3256e92ca3..ad9c765951f3092574c25662b8560a19cfd57fba 100644 (file)
@@ -58,7 +58,27 @@ The fields of the
 structure are as follows:
 .TP
 .I .d_ino
-This is the inode number of the file.
+This is the inode number of the file,
+which belongs to the filesystem
+.I .st_dev
+(see
+.BR stat (3type))
+of the directory on which
+.BR readdir ()
+was called.
+If the directory entry is the mount point,
+then
+.I .d_ino
+differs from
+.IR .st_ino :
+.I .d_ino
+is the inode number of the underlying mount point,
+while
+.I .st_ino
+is the inode number of the mounted file system.
+According to POSIX,
+this Linux behavior is considered to be a bug,
+but is nevertheless conforming.
 .TP
 .I .d_off
 The value returned in
index ee801bcece93e3dc55242e8189e2b54aeff69908..835626775b7042fc5b2489d2188911cdc10e463b 100644 (file)
@@ -66,7 +66,21 @@ and
 macros may be useful to decompose the device ID in this field.)
 .TP
 .I .st_ino
-This field contains the file's inode number.
+This field contains the file's inode number,
+which belongs to the
+.IR .st_dev .
+If
+.BR stat (2)
+was called on the mount point,
+then
+.I .d_ino
+differs from
+.IR .st_ino :
+.I .d_ino
+is the inode number of the underlying mount point,
+while
+.I .st_ino
+is the inode number of the mounted file system.
 .TP
 .I .st_mode
 This field contains the file type and mode.