Subject: Re: Commands i.e statfs.
To: Cameron Kaiser <spectre@stockholm.ptloma.edu>
From: Bill Studenmund <wrstuden@zembu.com>
List: port-mac68k
Date: 01/25/2001 11:20:23
On Wed, 24 Jan 2001, Cameron Kaiser wrote:

> > Where do the commands such as   statfs(2), fstatfs(2), getfsstat(2),
> > getmntinfo(3), fstab(5),  live before being installed? (what set?) Or do
> > these get installed as a package? (gnu or otherwise?)
> 
> In the OS itself (except for the last, which is in /etc). Lest you think this
> is a facetious answer, the first four are library functions designed to be
> used in C programs. /etc/fstab is an actual file, which describes your
> system's filesystem layout.
> 
> In general, (1) denotes user-land commands, (2)/(3) functions of various
> kinds for C, (5) denotes configuration file documentation, (6) denotes
> games and (8) denotes administrator utilities and daemons. These are the
> most common manual sections you will encounter, at least on BSD.

The difference between section (2) and section (3) C routines is that the
section (2) routines are actually kernel system calls. There are actuall
routines of the same name in libc which are wrappers - they do a little
setup, make the system call, and handle cleaning up on return. Clean up
includes interruptable & restartable system calls (while in a system call,
a signal can come in which gets handled, and then the program returns to
the system call) and errno (system calls can return both a value for errno
and a value as the return from the system call).

Also, if proberly done, it would make sense for other programming
languages to support all of the calls in section 2 of the manuals (since
they are built into the kernel), while section 3 routines would require
duplicating library support.

Take care,

Bill