IEEE Standards Interpretations for IEEE Std 1003.1™-2001 IEEE Standard for Information Technology - Portable Operating System Interface (POSIX®)
Copyright © 2006 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.
Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.
IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA
Interpretation Request #1
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.
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.
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 Interpretation
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".