DESCRIPTION

These routines are used to access the file system
description file /etc/fstab and the mounted file
system description file /etc/mtab.

The setmntent() function opens the file system
description file filep and returns a file pointer
which can be used by getmntent(). The argument
type is the type of access required and can take the
same values as the mode argument of
fopen(3).

The getmntent() function reads the next line from the
file system description file filep and returns a
pointer to a structure containing the broken out fields from
a line in the file. The pointer points to a static area of
memory which is overwritten by subsequent calls to
getmntent().

The addmntent() function adds the mntent structure
mnt to the end of the open file
filep.

The endmntent() function closes the file system
description file filep.

The hasmntopt() function scans the mnt_opts
field (see below) of the mntent structure mnt for a
substring that matches opt. See
for valid mount
options.

FILES

CONFORMING TO

SunOS 4.1.3.

NOTES

SysV also has a getmntent() function but the calling
sequence differs, and the returned structure is different.
Under SysV /etc/mnttab is used. BSD 4.4 and Digital
Unix have a routine getmntinfo(), a wrapper around
the system call getfsstat().

Please note that any user can change the contents of pages on this site,
and therefore the Waikato Linux Users Group can offer no assurances that
the information is correct, and the information on this site is not
necessarily the opinion of the Waikato Linux Users Group, or any of its
members. If you have any complaints about the contents of this page,
please do not hesitate to contact the Waikato Linux Users Group, or, click
the Edit button!

Unless otherwise noted, all pages on this site are licensed under the
WlugWikiLicense.