summaryrefslogtreecommitdiff
path: root/lib/libutil
diff options
context:
space:
mode:
authorjruoho <jruoho@NetBSD.org>2010-05-04 07:58:28 +0000
committerjruoho <jruoho@NetBSD.org>2010-05-04 07:58:28 +0000
commit43f2dd8f20bd02f4cdbc228271feb7d54770eb74 (patch)
treed5933378165630317b31bce85b793f95b8f78e0c /lib/libutil
parentdd121e1e5bd3e83c0dd11d724f1ff79e2c3a96a6 (diff)
Rework the example a little.
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/getmntopts.319
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/libutil/getmntopts.3 b/lib/libutil/getmntopts.3
index 9176eefbf14..9479d42a55b 100644
--- a/lib/libutil/getmntopts.3
+++ b/lib/libutil/getmntopts.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: getmntopts.3,v 1.10 2009/07/14 18:56:14 joerg Exp $
+.\" $NetBSD: getmntopts.3,v 1.11 2010/05/04 07:58:28 jruoho Exp $
.\"
.\" Copyright (c) 1994
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)getmntopts.3 8.3 (Berkeley) 3/30/95
.\"
-.Dd August 26, 2007
+.Dd May 4, 2010
.Dt GETMNTOPTS 3
.Os
.Sh NAME
@@ -183,7 +183,7 @@ flag, would also have an
.Dv MOPT_UPDATE
entry.
This can be declared and used as follows:
-.Bd -literal
+.Bd -literal -offset indent
#include \*[Lt]mntopts.h\*[Gt]
static const struct mntopt mopts[] = {
@@ -193,13 +193,20 @@ static const struct mntopt mopts[] = {
};
\&...
+
long val;
-mntflags = mntaltflags = 0;
mntoptparse_t mp;
+mntflags = mntaltflags = 0;
+
\&...
-if ((mp = getmntopts(options, mopts, \*[Am]mntflags, \*[Am]mntaltflags)) == NULL)
- err(1, NULL);
+
+mp = getmntopts(options, mopts, \*[Am]mntflags, \*[Am]mntaltflags);
+
+if (mp == NULL)
+ err(EXIT_FAILURE, "getmntopts");
+
\&...
+
val = getmntoptnum(mp, "rsize");
freemntopts(mp);
.Ed