System V statfs structure element semantics

Stephen Prince sp at labtam.OZ
Fri Sep 30 15:20:22 AEST 1988


In article <3826 at dunkshot.mips.COM>, dce at mips.COM (David Elliott) writes:

> and f_bfree gives you the
> same number minus the "minfree" space (usually 10%).  This means that
> if you do your math based on these numbers, an empty filesystem will
> appear to be 10% full.

But this "minfree" limit only applies to non-super-users. Do you report
something different for super-user?

> Are our values correct?

Would like to know the answer to that also. Having just been through the
exercise of porting the 4.3BSD file system to SVR3.

> What does the standard System V statfs do?

I'm not sure what you call standard, the 3 vols of SVID I have here,
don't have anything to say on this system call.  While the SVR3
Programmer's Reference Manual only makes reference in describing the
returned structure:

	long	f_blocks;	/* Total number of blocks */
	long	f_bfree;	/* Count of free blocks */

and looking at the source (fs/s5/s5sys3.c):

	f_blocks = the superblock field which gives the size in
		   blocks of the _entire_ volume (s_fsize)
	f_bfree  = superblock field which gives the _total_ free
		   blocks (s_tfree).

Since this point was not clarified, I decided to take the approach
used by the bsd version of df(1):

	f_blocks = # of data blocks in file system (fs_dsize)
	f_bfree  = (# of free blocks) * (# frag/block) + (# free frag)

of course the two values are converted to a 512 byte block size
before returning.

> Does System V have a notion of space that only the superuser can fill?

Not in our SysV version from N.S. (Genix).

/sp



More information about the Comp.unix.wizards mailing list