aboutsummaryrefslogtreecommitdiffstats
path: root/man3/getmntent.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/getmntent.3')
-rw-r--r--man3/getmntent.364
1 files changed, 48 insertions, 16 deletions
diff --git a/man3/getmntent.3 b/man3/getmntent.3
index 1ad69f9af1..8ca5f0d764 100644
--- a/man3/getmntent.3
+++ b/man3/getmntent.3
@@ -58,33 +58,47 @@ 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.
.PP
-The \fBsetmntent\fP() function opens the file system description file
+The
+.BR setmntent ()
+function opens the file system description file
\fIfp\fP and returns a file pointer which can be used by
-\fBgetmntent\fP().
+.BR getmntent ().
The argument \fItype\fP is the type of access
required and can take the same values as the \fImode\fP argument of
.BR fopen (3).
.PP
-The \fBgetmntent\fP() function reads the next line from the file system
+The
+.BR getmntent ()
+function reads the next line from the file system
description file \fIfp\fP 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 \fBgetmntent\fP().
+calls to
+.BR getmntent ().
.PP
-The \fBaddmntent\fP() function adds the mntent structure \fImnt\fP to
+The
+.BR addmntent ()
+function adds the mntent structure \fImnt\fP to
the end of the open file \fIfp\fP.
.PP
-The \fBendmntent\fP() function closes the file system description file
+The
+.BR endmntent ()
+function closes the file system description file
\fIfp\fP.
.PP
-The \fBhasmntopt\fP() function scans the \fImnt_opts\fP field (see below)
+The
+.BR hasmntopt ()
+function scans the \fImnt_opts\fP field (see below)
of the mntent structure \fImnt\fP for a substring that matches \fIopt\fP.
See \fI<mntent.h>\fP and
.BR mount (8)
for valid mount options.
.PP
-The reentrant \fBgetmntent_r\fP() function is similar to \fBgetmntent\fP(),
+The reentrant
+.BR getmntent_r ()
+function is similar to
+.BR getmntent (),
but stores the struct mount in the provided
.RI * mntbuf
and stores the strings pointed to by the entries in that struct
@@ -112,17 +126,31 @@ Since fields in the mtab and fstab files are separated by whitespace,
octal escapes are used to represent the four characters space (\e040),
tab (\e011), newline (\e012) and backslash (\e134) in those files
when they occur in one of the four strings in a mntent structure.
-The routines \fBaddmntent\fP() and \fBgetmntent\fP() will convert
+The routines
+.BR addmntent ()
+and
+.BR getmntent ()
+will convert
from string representation to escaped representation and back.
.SH "RETURN VALUE"
-The \fBgetmntent\fP() and \fBgetmntent_r\fP() functions return
+The
+.BR getmntent ()
+and
+.BR getmntent_r ()
+functions return
a pointer to the mntent structure or NULL on failure.
.PP
-The \fBaddmntent\fP() function returns 0 on success and 1 on failure.
+The
+.BR addmntent ()
+function returns 0 on success and 1 on failure.
.PP
-The \fBendmntent\fP() function always returns 1.
+The
+.BR endmntent ()
+function always returns 1.
.PP
-The \fBhasmntopt\fP() function returns the address of the substring if
+The
+.BR hasmntopt ()
+function returns the address of the substring if
a match is found and NULL otherwise.
.SH FILES
.nf
@@ -141,13 +169,17 @@ LSB deprecates the functions
and
.BR setmntent ().
.SH NOTES
-System V also has a \fBgetmntent\fP() function but the calling sequence
+System V also has a
+.BR getmntent ()
+function but the calling sequence
differs, and the returned structure is different.
Under System V
.I /etc/mnttab
is used.
-4.4BSD and Digital Unix have a routine \fBgetmntinfo\fP(),
-a wrapper around the system call \fBgetfsstat\fP().
+4.4BSD and Digital Unix have a routine
+.BR getmntinfo (),
+a wrapper around the system call
+.BR getfsstat ().
.SH "SEE ALSO"
.BR fopen (3),
.BR fstab (5),