vfs_getopt vfs_getopts vfs_flagopt vfs_scanopt vfs_copyopt vfs_filteropt - manipulate mount options and their values
The
vfs_getopts ();
function
returns the value of the specified option if it is a string (i.e.,
NUL
terminated).
The
vfs_flagopt ();
function determines if an option exists.
If the option does exist, and
Fa flags
is not
NULL
Fa flag
is added to those already set in
Fa flags .
If the option does not exist, and
Fa flags
is not
NULL
Fa flag
is removed from those already set in
Fa flags .
An example of typical usage is:
if (vfs_flagopt(mp->mnt_optnew, "wormlike", NULL, 0)) vfs_flagopt(mp->mnt_optnew, "appendok", &(mp->flags), F_APPENDOK);
The
vfs_scanopt ();
function performs a
vsscanf(3)
with the options value, using the given format,
into the specified variable arguments.
The value must be a string (i.e.,
NUL
terminated).
The
vfs_copyopt ();
function creates a copy of the options value.
The
Fa len
argument must match the length of the options value exactly
(i.e., a larger buffer will still cause
vfs_copyout ();
to fail with
Er EINVAL ) .
The
vfs_filteropt ();
function ensures that no unknown options were specified.
A option is valid if its name matches one of the names in the
list of legal names.
An option may be prefixed with 'no', and still be considered valid.
The
vfs_getops ();
function returns the specified option if it is found, and is
NUL
terminated.
If the option was found, but is not
NUL
terminated,
Fa error
is set to
Er EINVAL
and
NULL
is returned.
If the option was not found,
Fa error
is set to 0, and
NULL
is returned.
The
vfs_flagopt ();
function returns 1 if the option was found, and 0 if it was not.
The
vfs_scanopt ();
function returns 0 if the option was not found, or was not
NUL
terminated; otherwise, the return value of
vsscanf(3)
is returned.
If
vsscanf(3)
returns 0, it will be returned unchanged; therefore, a return value of 0 does
not always mean the option does not exist, or is not a valid string.
The
vfs_copyopt ();
function returns 0 if the copy was successful,
Er EINVAL
if the option was found but the lengths did not match, and
Er ENOENT
if the option was not found.
The
vfs_filteropt ();
function returns 0 if all of the options are legal; otherwise,
Er EINVAL
is returned.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |