git: 4c58eef12d30 - main - stat.2: enhance the description of st_blocks

Konstantin Belousov <[email protected]> Sun, 02 Aug 2026 22:17:50 +0000
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a6fc20e.3e528.67e4050a__28079.9508140021$1785709151$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=4c58eef12d30ec699c86d9ab8939253adbf35e79

commit 4c58eef12d30ec699c86d9ab8939253adbf35e79
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-08-02 14:57:37 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-08-02 22:17:28 +0000

    stat.2: enhance the description of st_blocks
    
    Reviewed by:    emaste, mckusick
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Differential revision:  https://reviews.freebsd.org/D58592
---
 lib/libsys/stat.2 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/libsys/stat.2 b/lib/libsys/stat.2
index b31975ee068f..c16af32a340d 100644
--- a/lib/libsys/stat.2
+++ b/lib/libsys/stat.2
@@ -263,9 +263,19 @@ File size in bytes.
 .It Va st_blksize
 Optimal I/O block size for the file.
 .It Va st_blocks
-Actual number of blocks allocated for the file in 512-byte units.
+Actual number of blocks allocated for the file.
+.Pp
+For files located on non-synthetic filesystems, the block size is 512 bytes.
 As short symbolic links are stored in the inode, this number may
 be zero.
+.Pp
+For file descriptors referencing specific non-file objects,
+the field is type-specific.
+For POSIX shared memory segments
+.Pq see Xr shm_open 2 ,
+the block size is equal to
+the platform page size
+.Pq Xr getpagesize 2 .
 .El
 .Pp
 The access-related fields of