Copyright © 2006 IEEE. All rights reserved.
Defect Report concerning (number and title of International Standard
or DIS final text, if applicable):
The Base Definitions Volume of IEEE Std 1003.1-2001
------------------------------------------------------------------------
Qualifier (e.g. error, omission, clarification required):
Omission
------------------------------------------------------------------------
References in document (e.g. page, clause, figure, and/or table
numbers):
Page: 355 Line: 12638 Section:
XBD Enhancement Request Number 34
------------------------------------------------------------------------
Nature of defect (complete, concise explanation of the perceived
problem):
Problem:
Also line 12754
The standard mentions the struct stat member st_blocks but does not
mention the blocksize (e.g. multiplicator) to be used with the st_blocks
field.
Without knowing the blocksize, the field 'st_blocks' does not make sense.
------------------------------------------------------------------------
Solution proposed by the submitter (optional):
Add a definition for the blocksize after lines 12754/12755. As all
known UNIX implementations (except HP-UX) use 512 bytes as multiplicator
for the blocksize used with st_blocks, it would make sense to
standardize on 512 byte blocks for this field.
------------------------------------------------------------------------
Interpretation response
------------------------
The standard does not speak to the issue of the units
of the st_blocks member of the stat structure, and as such
no conformance distinction can be made between alternative
implementations based on this. This is being referred to the
sponsor.
Rationale
-------------
For consideration of inclusion in technical corrigendum number the
committee has proposed to add the following rationale:
"The units for the st_blocks member of the stat structure is not defined
within the standard. In some implementations it is 512 bytes. It may
differ on a filesystem basis.There is no correlation between values of
the st_blocks and st_blksize and the f_bsize (from )
structure members.
Traditionally some implementations defined the
multiplier for st_blocks in as the symbol DEV_BSIZE."
Further information not part of the Interpretation
--------------------------------------------------
Here is the result of investigations on NFS:
- NFSv2 includes the "st_blocks" member in the file attributes
but is also unclear about the size of a "block"
- NFSv3 removed the "st_blocks" equivalent in the file attributes
and included a "used" field instead. The "used" field counts
the occupied disk space in bytes.
A possible idea for a future standard could be to follow this idea in struct stat and replace st_blocks by "st_used".
_____________________________________________________________________________
Back to IEEE Standards Interpretations for IEEE Std 1003.1-2001