Question about ustat(2) and free disk space

Dave Ihnat, Chicago, IL ignatz at ihuxx.UUCP
Fri Mar 30 11:39:53 AEST 1984


	Hello.  I was reading "The Programmer's Workbench" (an article
	in the 1978 special UNIX issue of the Bell Systems Technical
	Journal), and I noticed the following sentence:
	
		"The ustat system call was added to allow programs
		to discover the amount of free space remaining in a
		file system."
	
	Since I haven't seen ustat in the V7, Sys III, or 4.1BSD
	documentation, I'd like to know:
	
		1) What happened to ustat?
		2) What are/were it's arguments?  I assume it returned a
		   long, for the number of bytes (where -1 might mean
		   an error of some sort).
		3) How can someone do the same thing without using the ustat
		   system call?
		4) How does df(1) work?
	
	Thanks in advance...
					Chief question asker
	-- 
					JR (John Rogers)
					UUCP: forcm5!jr, fortune!jr, proper!jr
					CompuServe: 70140,213

Excuse me, John...but I just looked at Sys III, V, and V.2 documentation.
All clearly list info on the ustat(2) call.  Interface is:

	#include <sys/types.h>
	#include <ustat.h>

	int ustat(dev,buf)
	int dev;
	struct ustat *buf;

It returns total free blocks, number of free inodes, the filsys name, and
the filsys pack name.  (All of this is USG.  Dammfino what it looks like
for BSD.) And this is how df(1) does it.

				Dave Ihnat
				ihuxx!ignatz



More information about the Comp.unix mailing list