what are st_blksize and st_blocks exactly?

Larry McVoy lm at snafu.Sun.COM
Sun Jul 15 10:50:45 AEST 1990


In article <DJM.90Jul13133859 at twiddle.eng.umd.edu> djm at eng.umd.edu (David J. MacKenzie) writes:
>The stat(2) documentation for SunOS 4.0.3 says:
>
>	  long	    st_blksize;	   /* preferred	blocksize for file system I/O*/
>	  long	    st_blocks;	   /* actual number of blocks allocated	*/
>
>It doesn't mention what units st_blocks is measured in, but those
>units don't look like they're the value of st_blksize.
>How are these two fields related, if at all?
>Is st_blocks always measured in 512 byte units, or is there a value
>somewhere that indicates the block size for it?

st_blocks is in units of 512 bytes since the beginning of time.  It's unlikely
to change (sigh).  st_blksize is the file system block size, usually 8K on
BSD derived systems.
---
Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm at sun.com



More information about the Comp.unix.wizards mailing list