Skip to content

expose st_blksize field from fstat syscall

The libc manual talks about buffer sizes.

https://www.gnu.org/software/libc/manual/html_node/Controlling-Buffering.html

They advise: Actually, you can get an even better value to use for the buffer size by means of the fstat system call: it is found in the st_blksize field of the file attributes. See Attribute Meanings.

It's just that the st_blksize field it stepped over in the haskell definition of it:

https://github.com/haskell/unix/blob/8d188ed8067af17dfcc2cd6cbbfda7294ba17e17/System/Posix/Files/Common.hsc#L280-L283

Which goes directly from filesize to accesstime

See also https://linux.die.net/man/2/fstat

Would be nice to expose the additional fields as well

Trac metadata
Trac field Value
Version 8.6.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component libraries/unix
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information