<div dir="ltr">My patch to fix df behavior on macOS broke the stat build on macOS.<br><br>First off, we had %s and %S the wrong way round compared to coreutils,<br>though since Linux always seems to use the same value for both,<br>no-one will ever have noticed.<br><br>Annoyingly, Linux and macOS disagree about what statfs::f_bsize<br>means, and whether statfs::f_iosize and statfs::f_frsize exist (each<br>has one or the other, depending on what f_bsize *doesn't* mean to<br>them). This mess is presumably why statvfs exists.<br><br>Unfortunately, statvfs on macOS at least doesn't contain the file<br>system type information.  So we either need to do *both* statfs()<br>and statvfs() for macOS, or we need to take into account the different<br>fields.<br><br>This patch adds an #ifdef outside of portability.h because I wasn't<br>sure we actually wanted to add statfs_best_transfer_size() and<br>statfs_real_block_size() functions to lib for this. But that's an<br>easy cleanup if desired.<br>---<br> toys/other/stat.c | 12 +++++++++---<br> 1 file changed, 9 insertions(+), 3 deletions(-)<br><br></div>