In struct statvfs
(which is used by the statvfs
syscall), there are two fields: f_bsize
and f_frsize
. What exactly do they stand for? Or to be more specific, if I need to get the logical block size of the filesystem, which one should I use?
It is very confusing, because in the Linux man page, it is said:
unsigned long f_bsize; /* file system block size */
unsigned long f_frsize; /* fragment size */
It seems like f_bsize is the logical block size which I need, while in the man page of macOS, it is said:
f_frsize The size in bytes of the minimum unit of allocation on this file system. (This corresponds to the f_bsize member of struct statfs.)
f_bsize The preferred length of I/O requests for files on this file system. (Corresponds to the f_iosize member of struct statfs.)
It seems like f_frsize is the logical block size, finally I checked the POSIX standards, and here is the specification:
unsigned long f_bsize File system block size.
unsigned long f_frsize Fundamental file system block size.
I have googled for a while and failed to find the definition of the "Fundamental file system block size. Is there anybody who can help?