2 .\" Copyright (C) 2007 Chad David <davidc@acns.ab.ca>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice(s), this list of conditions and the following disclaimer as
9 .\" the first lines of this file unmodified other than the possible
10 .\" addition of one or more copyright notices.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice(s), this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 .\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
39 .Nd "manipulate mount options and their values"
45 .Fa "struct vfsoptlist *opts" "const char *name" "void **buf" "int *len"
48 .Fn vfs_getops "struct vfsoptlist *opts" "const char *name" "int *error"
51 .Fa "struct vfsoptlist *opts" "const char *name" "u_int *flags" "u_int flag"
55 .Fa "struct vfsoptlist *opts" "const char *name" "const char *fmt" ...
59 .Fa "struct vfsoptlist *opts" "const char *name" "void *dest" "int len"
63 .Fa "struct vfsoptlist *opts" "const char **legal"
70 to point to the value of the named mount option, and sets
72 to the length of the value if it is not
77 will point to the actual value, and does not need to be freed or released
78 (and probably should not be modified).
83 returns the value of the specified option if it is a string (i.e.,
89 function determines if an option exists.
90 If the option does exist, and
95 is added to those already set in
97 If the option does not exist, and
102 is removed from those already set in
104 An example of typical usage is:
106 if (vfs_flagopt(mp->mnt_optnew, "wormlike", NULL, 0))
107 vfs_flagopt(mp->mnt_optnew, "appendok", &(mp->flags), F_APPENDOK);
114 with the options value, using the given format,
115 into the specified variable arguments.
116 The value must be a string (i.e.,
122 function creates a copy of the options value.
125 argument must match the length of the options value exactly
126 (i.e., a larger buffer will still cause
133 function ensures that no unknown options were specified.
134 A option is valid if its name matches one of the names in the
136 An option may be prefixed with 'no', and still be considered valid.
140 function returns 0 if the option was found; otherwise,
146 function returns the specified option if it is found, and is
149 If the option was found, but is not
158 If the option was not found,
166 function returns 1 if the option was found, and 0 if it was not.
170 function returns 0 if the option was not found, or was not
172 terminated; otherwise, the return value of
177 returns 0, it will be returned unchanged; therefore, a return value of 0 does
178 not always mean the option does not exist, or is not a valid string.
182 function returns 0 if the copy was successful,
184 if the option was found but the lengths did not match, and
186 if the option was not found.
190 function returns 0 if all of the options are legal; otherwise,
195 This manual page was written by
196 .An Chad David Aq davidc@FreeBSD.org
198 .An Ruslan Ermilov Aq ru@FreeBSD.org .