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
42 .Nd "manipulate mount options and their values"
48 .Fa "struct vfsoptlist *opts" "const char *name" "void **buf" "int *len"
51 .Fn vfs_getops "struct vfsoptlist *opts" "const char *name" "int *error"
54 .Fa "struct vfsoptlist *opts" "const char *name" "uint64_t *flags" "uint64_t flag"
58 .Fa "struct vfsoptlist *opts" "const char *name" "const char *fmt" ...
62 .Fa "struct vfsoptlist *opts" "const char *name" "void *dest" "int len"
66 .Fa "struct vfsoptlist *opts" "const char **legal"
70 .Fa "struct vfsoptlist *opts" "const char *name" "void *value" "int len"
74 .Fa "struct vfsoptlist *opts" "const char *name" "void *value" "int len"
78 .Fa "struct vfsoptlist *opts" "const char *name" "const char *value"
85 to point to the value of the named mount option, and sets
87 to the length of the value if it is not
92 will point to the actual value, and does not need to be freed or released
93 (and probably should not be modified).
98 returns the value of the specified option if it is a string (i.e.,
104 function determines if an option exists.
105 If the option does exist, and
110 is added to those already set in
112 If the option does not exist, and
117 is removed from those already set in
119 An example of typical usage is:
121 if (vfs_flagopt(mp->mnt_optnew, "wormlike", NULL, 0))
122 vfs_flagopt(mp->mnt_optnew, "appendok", &(mp->flags), F_APPENDOK);
129 with the option's value, using the given format,
130 into the specified variable arguments.
131 The value must be a string (i.e.,
137 function creates a copy of the option's value.
140 argument must match the length of the option's value exactly
141 (i.e., a larger buffer will still cause
148 function ensures that no unknown options were specified.
149 A option is valid if its name matches one of the names in the
151 An option may be prefixed with 'no', and still be considered valid.
157 functions copy new data into the option's value.
162 argument must match the length of the option's value exactly
163 (i.e., a larger buffer will still cause
170 function copies a new string into the option's value.
171 The string, including
173 byte, must be no longer than the option's length.
177 function returns 0 if the option was found; otherwise,
183 function returns the specified option if it is found, and is
186 If the option was found, but is not
195 If the option was not found,
203 function returns 1 if the option was found, and 0 if it was not.
207 function returns 0 if the option was not found, or was not
209 terminated; otherwise, the return value of
214 returns 0, it will be returned unchanged; therefore, a return value of 0 does
215 not always mean the option does not exist, or is not a valid string.
221 functions return 0 if the copy was successful,
223 if the option was found but the lengths did not match, and
225 if the option was not found.
229 function returns 0 if all of the options are legal; otherwise,
235 function returns 0 if the copy was successful,
237 if the option was found but the string was too long, and
239 if the option was not found.
242 This manual page was written by
243 .An Chad David Aq Mt davidc@FreeBSD.org
245 .An Ruslan Ermilov Aq Mt ru@FreeBSD.org .