What, exactly, are stat.st_blocks, statfs.f_bsize?

Robert Elz kre at cs.mu.OZ.AU
Mon Mar 4 08:28:41 AEST 1991


st_blocks should be in units of the most elementary allocation amount
(which is typically disc sectors) - that's required for accuracy in the
count.  Factors of that number are OK, but wasteful, multiples of it
(picking a "nice" number) are simply wrong.   This is definitely a
system dependant number (and could be file system dependant).

Programs reporting this number should probably convert it to a useful
standard unit in most cases, for this purpose it doesn't matter much
what that unit is - I believe POSIX chose units of 512 for most
applications, I would have thought 1K was more human friendly.

kre



More information about the Comp.unix.internals mailing list