|
C support for NFS
The support for NFS mounting in the standard C library is through two
sources. NFS is based on the Sun's RPC system, so the basic calls are only
instances of standard RPC protocols.
The C functions in the standard input/output library can be used to access
NFS filesystems. Since NFS imitates the UNIX filesystem as closely as possible,
NFS filesystems can be mounted in exactly the same way as ordinary filesystems.
Unfortunately, the C functions which perform the mount operation in UNIX and
depressingly non-standard. They differ on almost every implementation of UNIX.
The basic function which mounts a filesystem, in
´mount' (see
man (2) mount). The mount table is
stored in a file /etc/mtab on BSD systems (again the name varies wildly
from UNIX to UNIX, mnttab on HPUX for instance). The file /etc/rmtab on
an NFS server contains a list of remote-mounted filesystems which are mounted by
remote clients. C functions exist which can read the filesystem tables and place
the resulting data in C struct types. Alas, these struct defintions are also
quite different on different systems. See
´/usr/include/sys/mount.h', so the
user wishing to write system-independent code is confounded at the lowest level.
|