This structure is used with the getmntent , getmntent_t ,
addmntent , and hasmntopt functions.
char *mnt_fsname
- This element contains a pointer to a string describing the name of the
special device from which the filesystem is mounted. It corresponds to
the
fs_spec element in struct fstab .
char *mnt_dir
- This element points to a string describing the mount point of the
filesystem. It corresponds to the
fs_file element in
struct fstab .
char *mnt_type
mnt_type describes the filesystem type and is therefore
equivalent to fs_vfstype in struct fstab . mntent.h
defines a few symbolic names for some of the values this string can have.
But since the kernel can support arbitrary filesystems it does not
make much sense to give them symbolic names. If one knows the symbol
name one also knows the filesystem name. Nevertheless here follows the
list of the symbols provided in mntent.h .
MNTTYPE_IGNORE
- This symbol expands to
"ignore" . The value is sometime used in
fstab files to make sure entries are not used without removing them.
MNTTYPE_NFS
- Expands to
"nfs" . Using this macro sometimes could make sense
since it names the default NFS implementation, in case both version 2
and 3 are supported.
MNTTYPE_SWAP
- This symbol expands to
"swap" . It names the special fstab
entry which names one of the possibly multiple swap partitions.
char *mnt_opts
- The element contains a string describing the options used while mounting
the filesystem. As for the equivalent element
fs_mntops of
struct fstab it is best to use the function getsubopt
(see Suboptions) to access the parts of this string.
The mntent.h file defines a number of macros with string values
which correspond to some of the options understood by the kernel. There
might be many more options which are possible so it doesn't make much sense
to rely on these macros but to be consistent here is the list:
MNTOPT_DEFAULTS
- Expands to
"defaults" . This option should be used alone since it
indicates all values for the customizable values are chosen to be the
default.
MNTOPT_RO
- Expands to
"ro" . See the FSTAB_RO value, it means the
filesystem is mounted read-only.
MNTOPT_RW
- Expand to
"rw" . See the FSTAB_RW value, it means the
filesystem is mounted with read and write permissions.
MNTOPT_SUID
- Expands to
"suid" . This means that the SUID bit (see How
Change Persona) is respected when a program from the filesystem is
started.
MNTOPT_NOSUID
- Expands to
"nosuid" . This is the opposite of MNTOPT_SUID ,
the SUID bit for all files from the filesystem is ignored.
MNTOPT_NOAUTO
- Expands to
"noauto" . At startup time the mount program
will ignore this entry if it is started with the -a option to
mount all filesystems mentioned in the fstab file.
As for the FSTAB_* entries introduced above it is important to
use strcmp to check for equality.
mnt_freq
- This elements corresponds to
fs_freq and also specifies the
frequency in days in which dumps are made.
mnt_passno
- This element is equivalent to
fs_passno with the same meaning
which is uninteresting for all programs beside dump .
|