home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.unix.wizards
- Subject: Re: A few UNIX questions
- Message-ID: <14343@auspex-gw.auspex.com>
- Date: 28 Aug 92 01:15:13 GMT
- References: <32176@adm.brl.mil> <1992Aug26.081414.6932@sniap.mchp.sni.de> <1992Aug27.162220.16130@krfiny.uucp>
- Sender: news@auspex-gw.auspex.com
- Organization: Auspex Systems, Santa Clara
- Lines: 23
- Nntp-Posting-Host: bootme.auspex.com
-
- >That's why SVR4 expanded stat to return a generic stat structure
- >with provisions for reporting file size (in blocks), block size,
- >and offset to last byte.
-
- Actually, the "block size", "st_blksize", isn't supposed to be the size
- of the blocks that are the units of the file size; it's supposed to be
- "a hint as to the 'best' unit size for I/O operations," to quote my SVR4
- manuals. (Yes, that's the same thing "st_blksize" is in BSD. Yes,
- that's whence SVR4 got it, via SunOS.)
-
- "st_blocks", the file size in blocks, is, to quote my SVR4 manuals, "the
- total number of physical blocks of size 512 bytes actually allocated on
- disk"; this is intended to include file system overhead such as indirect
- blocks. (Yes, that's the same thing "st_blocks" is in BSD. Yes, that's
- whence SVR4 got it, via SunOS.)
-
- Yes, the comment on the "st_blocks" field in the description of the
- contents of "struct stat", at least in the SVR4 manuals I have, is
- wrong; it lies and claims that "st_blocks" is in units of
- "st_blksize"-size blocks. That's bogus. (Yes, there may well be UNIX
- systems in which "st_blocks" is in units of "st_blksize"-size blocks.
- "st_blocks", in those UNIX systems, is bogus, and the vendors of those
- systems should go fix them ASAP.)
-