.\" Modified Sat Jul 24 21:46:57 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified 961109, 031115, aeb
.\"
-.TH GETMNTENT 3 2009-09-15 "" "Linux Programmer's Manual"
+.TH GETMNTENT 3 2015-01-22 "" "Linux Programmer's Manual"
.SH NAME
getmntent, setmntent, addmntent, endmntent, hasmntopt,
-getmntent_r \- get file system descriptor file entry
+getmntent_r \- get filesystem descriptor file entry
.SH SYNOPSIS
.nf
.B #include <stdio.h>
.sp
.BI "FILE *setmntent(const char *" filename ", const char *" type );
.sp
-.BI "struct mntent *getmntent(FILE *" fp );
+.BI "struct mntent *getmntent(FILE *" stream );
.sp
-.BI "int addmntent(FILE *" fp ", const struct mntent *" mnt );
+.BI "int addmntent(FILE *" stream ", const struct mntent *" mnt );
.sp
-.BI "int endmntent(FILE *" fp );
+.BI "int endmntent(FILE *" streamp );
.sp
.BI "char *hasmntopt(const struct mntent *" mnt ", const char *" opt );
.sp
/* GNU extension */
.B #include <mntent.h>
.sp
-.BI "struct mntent *getmntent_r(FILE *" fp ", struct mntent *" mntbuf ,
+.BI "struct mntent *getmntent_r(FILE *" streamp ", struct mntent *" mntbuf ,
.BI " char *" buf ", int " buflen );
.fi
.sp
.BR getmntent_r ():
_BSD_SOURCE || _SVID_SOURCE
.SH DESCRIPTION
-These routines are used to access the file system description file
-\fI/etc/fstab\fP and the mounted file system description file
-\fI/etc/mtab\fP.
+These routines are used to access the filesystem description file
+.I /etc/fstab
+and the mounted filesystem description file
+.IR /etc/mtab .
.PP
The
.BR setmntent ()
-function opens the file system description file
-\fIfilename\fP and returns a file pointer which can be used by
+function opens the filesystem description file
+.I filename
+and returns a file pointer which can be used by
.BR getmntent ().
-The argument \fItype\fP is the type of access
-required and can take the same values as the \fImode\fP argument of
+The argument
+.I type
+is the type of access
+required and can take the same values as the
+.I mode
+argument of
.BR fopen (3).
.PP
The
.BR getmntent ()
-function reads the next line from the file system
-description file \fIfp\fP and returns a pointer to a structure
+function reads the next line of the filesystem
+description file from
+.I stream
+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
.BR addmntent ()
function adds the
.I mntent
-structure \fImnt\fP to
-the end of the open file \fIfp\fP.
+structure
+.I mnt
+to
+the end of the open
+.IR stream .
.PP
The
.BR endmntent ()
-function closes the file system description file
-\fIfp\fP.
+function closes the
+.IR stream
+associated with the filesystem description file.
.PP
The
.BR hasmntopt ()
-function scans the \fImnt_opts\fP field (see below)
+function scans the
+.I mnt_opts
+field (see below)
of the
.I mntent
-structure \fImnt\fP for a substring that matches \fIopt\fP.
-See \fI<mntent.h>\fP and
+structure
+.I mnt
+for a substring that matches
+.IR opt .
+See
+.I <mntent.h>
+and
.BR mount (8)
for valid mount options.
.PP
.BR getmntent_r ()
function is similar to
.BR getmntent (),
-but stores the \fIstruct mount\fP in the provided
+but stores the
+.IR "struct mount"
+in the provided
.I *mntbuf
and stores the strings pointed to by the entries in that struct
in the provided array
of size
.IR buflen .
.PP
-The \fImntent\fP structure is defined in \fI<mntent.h>\fP as follows:
+The
+.I mntent
+structure is defined in
+.I <mntent.h>
+as follows:
.sp
.in +4n
.nf
struct mntent {
- char *mnt_fsname; /* name of mounted file system */
- char *mnt_dir; /* file system path prefix */
+ char *mnt_fsname; /* name of mounted filesystem */
+ char *mnt_dir; /* filesystem path prefix */
char *mnt_type; /* mount type (see mntent.h) */
char *mnt_opts; /* mount options (see mntent.h) */
int mnt_freq; /* dump frequency in days */
a match is found and NULL otherwise.
.SH FILES
.nf
-/etc/fstab file system description file
-/etc/mtab mounted file system description file
+/etc/fstab filesystem description file
+/etc/mtab mounted filesystem description file
.fi
.SH CONFORMING TO
The nonreentrant functions are from SunOS 4.1.3.
.BR fopen (3),
.BR fstab (5),
.BR mount (8)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.