HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)

g
getmntent(3X) getmntent(3X)
hasmntopt() Scans the mnt_opts field of the
mntent structure mnt for a substring that
matches opt. It returns the address of the substring if a match is found;
0 otherwise.
endmntent() Closes the file.
The following definitions are provided in <
mntent.h>:
#define MNT_CHECKLIST "/etc/fstab"
#define MNT_MNTTAB "/etc/mnttab"
#define MNTMAXSTR 128 /* Max size string in mntent */
#define MNTTYPE_HFS "hfs" /* HFS file system */
#define MNTTYPE_CDFS "cdfs" /* CD-ROM file system */
#define MNTTYPE_NFS "nfs" /* Network file system */
#define MNTTYPE_SWAP "swap" /* Swap device */
#define MNTTYPE_SWAPFS "swapfs" /* File system swap */
#define MNTTYPE_IGNORE "ignore" /* Ignore this entry */
#define MNTOPT_DEFAULTS "defaults" /* Use all default options */
#define MNTOPT_RO "ro" /* Read only */
#define MNTOPT_RW "rw" /* Read/write */
#define MNTOPT_SUID "suid" /* Set uid allowed */
#define MNTOPT_NOSUID "nosuid" /* No set uid allowed */
#define MNTOPT_QUOTA "quota" /* Enable disk quotas */
#define MNTOPT_NOQUOTA "noquota" /* Disable disk quotas */
The following definition is provided for device swap in <mntent.h>:
#define MNTOPT_END "end" /* swap after end of file system,
Series 300/400/700 only */
The following definitions are provided for file system swap in <mntent.h>:
#define MNTOPT_MIN "min" /* minimum file system swap */
#define MNTOPT_LIM "lim" /* maximum file system swap */
#define MNTOPT_RES "res" /* reserve space for file system */
#define MNTOPT_PRI "pri" /* file system swap priority */
NETWORKING FEATURES
NFS
The following definitions are provided in <mntent.h>:
#define MNTOPT_BG "bg" /* Retry mount in background */
#define MNTOPT_FG "fg" /* Retry mount in foreground */
#define MNTOPT_RETRY "retry" /* Number of retries allowed */
#define MNTOPT_RSIZE "rsize" /* Read buffer size in bytes */
#define MNTOPT_WSIZE "wsize" /* Write buffer size in bytes*/
#define MNTOPT_TIMEO "timeo" /* Timeout in 1/10 seconds */
#define MNTOPT_RETRANS "retrans" /* Number of retransmissions */
#define MNTOPT_PORT "port" /* Server’s IP NFS port */
#define MNTOPT_SOFT "soft" /* Soft mount */
#define MNTOPT_HARD "hard" /* Hard mount */
#define MNTOPT_INTR "intr" /* Interruptible hard mounts */
#define MNTOPT_NOINTR "nointr" /* Uninterruptible hard mounts*/
#define MNTOPT_DEVS "devs" /* Device file access allowed */
#define MNTOPT_NODEVS "nodevs" /* No device file access allowed */
RETURN VALUE
setmntent() Returns a null pointer on error. setmntent() attempts to establish an exclusive
write lock on the file it is opening, ie: when one of the following types is passed to
setmntent() to open the file for write/update: "w", "a", "r+", "w+", or "a+". If
setmntent() cannot get the lock, it returns a null pointer and sets errno to either
[EACESS] or [EAGAIN].
getmntent() Returns a null pointer on error or EOF. Otherwise, getmntent() returns a
pointer to a mntent structure. Some of the fields comprising a mntent structure are
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 3341