Rein Klazes wijn@wanadoo.nl writes:
Totals size of the file system should be f_blocks * f_frsize, but that gives a value 16 times too small. In this case f_blocks (as f_bfree, f_bavail) are the number of f_bsize blocks, wrong. This is a quite up-to-date system, Debian unstable with 2.6.10 kernel.
Attached is the simplest solution, fall back to fstatfs() on Linux systems. It is btw also what 'df' does.
Wouldn't it be easier to simply use f_bsize instead of f_frsize? Why would switching to fstatfs be preferable?