<div dir="ltr">On Linux, struct statvfs' f_bsize and f_frsize seem to be<br>interchangeable. On macOS, they're wildly different. f_bsize is the<br>"preferred length of I/O requests for files on this file system"<br>(corresponding to statfs::f_iosize), and f_frsize is the "size in<br>bytes of the minimum unit of allocation on this file system"<br>(corresponding to statfs::f_bsize. POSIX appears to say nothing<br>about the interpretation of these fields, but <a href="http://man7.org">man7.org</a>'s statvfs(2)<br>page is quite clear that statvfs::f_blocks, for example, is in units<br>of f_frsize, not f_bsize.<br><br>This is the only place in the tree where we use statvfs::f_bsize<br>(other than the stat(1) output that's supposed to be f_bsize and<br>that has a corresponding f_frsize dual anyway.<br><br>I've removed the Apple-specific #define f_frsize in portability.h<br>because that seems to have been from my previous attempt to understand<br>what was going on here. The output of the relevant stat(1) fields<br>on macOS are the same before/after this patch.<br><br>This makes toybox df's output match the system's df on a MacBook<br>Pro running macOS 11.2.1.<br><br>Tested on a Raspberry Pi 400 running Linux too, where I see no<br>change in the output before/after this patch.<br>---<br> lib/portability.h | 4 ----<br> toys/posix/df.c   | 2 +-<br> 2 files changed, 1 insertion(+), 5 deletions(-)<br><br></div>