Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167164925
D58942.id184303.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D58942.id184303.diff
View Options
diff --git a/lib/libsys/stat.2 b/lib/libsys/stat.2
--- a/lib/libsys/stat.2
+++ b/lib/libsys/stat.2
@@ -271,10 +271,14 @@
.Pp
For file descriptors referencing specific non-file objects,
the field is type-specific.
+.Pp
For POSIX shared memory segments
.Pq see Xr shm_open 2 ,
-the block size is equal to
-the platform page size
+the block size is 512 bytes.
+For older versions of
+.Fx
+.Pq before 15.2 and 16.0
+the block size was equal to the platform page size
.Pq Xr getpagesize 2 .
.El
.Pp
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -658,12 +658,8 @@
sb->st_dev = shm_dev_ino;
sb->st_ino = shmfd->shm_ino;
sb->st_nlink = shmfd->shm_object->ref_count;
- if (shm_largepage(shmfd)) {
- sb->st_blocks = shmfd->shm_object->size /
- (pagesizes[shmfd->shm_lp_psind] >> PAGE_SHIFT);
- } else {
- sb->st_blocks = shmfd->shm_pages;
- }
+ sb->st_blocks = ptoa(shm_largepage(shmfd) ? shmfd->shm_object->size :
+ shmfd->shm_pages) / DEV_BSIZE;
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 20, 2:52 PM (6 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36985631
Default Alt Text
D58942.id184303.diff (1 KB)
Attached To
Mode
D58942: shmfd: consistently return size in 512 byte blocks for fstat st_blocks
Attached
Detach File
Event Timeline
Log In to Comment