Hi Chris

On Thu, Sep 11, 2008 at 1:57 AM, Chris Frost <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 09, 2008 at 07:03:11AM +0200, Michael Kerrisk wrote:
>> This report is rather vague.  It would be useful to explain how the
>> page "seems to imply that struct stat.st_blocks is in the same units
>> as stat.st_blocksize" and even better if you had some suggestion about
>> how you think the text should change.
>
>
> The relevant stat(2) struct stat snippet is:
>        struct stat {
>                ...
>                blksize_t st_blksize; /* blocksize for filesystem I/O */
>                blkcnt_t  st_blocks;  /* number of blocks allocated */
>                ...
>        }
>
> The two fields use the same word, "block", with two different meanings.
>
> In particular, to make use of the st_blocks field, "number of blocks
> allocated", one may need to know the size of a "block". Given
> st_blksize's description, "blocksize for filesystem I/O", it appears
> that its purpose is to describe the size of the block unit used for
> st_blocks.
>
> Does this convey why I find these fields vague?

Okay.  I think part of the problem (from my upstream point of view) is
that you are looking at rather old man-pages.  (2.39 is about 50
releases ago.)  Already by the time of your report, the upstream page
mentioned the 512B figure in the text describing st_blocks.  And...

> A suggestion for their description:
> st_blksize; /* file system I/O block size */
> st_blocks;  /* disk blocks (e.g., sectors) allocated */
>
> Or if st_blocks is always in units of 512 B, this may be more clear:
> st_blocks;  /* number of 512 B blocks allocated */

After my reply to your earlier mail I decided to make exactly the
change in the preceing line.  The change is already out, in
man-pages-3.09, look here:

http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html

Does this version of the page address your concerns?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to