xref: /freebsd/lib/libc/gen/getvfsbyname.3 (revision 1d104f9fbd14f5b49b90b3246b7fce065a1347b7)
1662909a7SPeter Wemm.\" Copyright (c) 1995
2662909a7SPeter Wemm.\"	The Regents of the University of California.  All rights reserved.
3662909a7SPeter Wemm.\"
4662909a7SPeter Wemm.\" Redistribution and use in source and binary forms, with or without
5662909a7SPeter Wemm.\" modification, are permitted provided that the following conditions
6662909a7SPeter Wemm.\" are met:
7662909a7SPeter Wemm.\" 1. Redistributions of source code must retain the above copyright
8662909a7SPeter Wemm.\"    notice, this list of conditions and the following disclaimer.
9662909a7SPeter Wemm.\" 2. Redistributions in binary form must reproduce the above copyright
10662909a7SPeter Wemm.\"    notice, this list of conditions and the following disclaimer in the
11662909a7SPeter Wemm.\"    documentation and/or other materials provided with the distribution.
12662909a7SPeter Wemm.\" 3. All advertising materials mentioning features or use of this software
13662909a7SPeter Wemm.\"    must display the following acknowledgement:
14662909a7SPeter Wemm.\"	This product includes software developed by the University of
15662909a7SPeter Wemm.\"	California, Berkeley and its contributors.
16662909a7SPeter Wemm.\" 4. Neither the name of the University nor the names of its contributors
17662909a7SPeter Wemm.\"    may be used to endorse or promote products derived from this software
18662909a7SPeter Wemm.\"    without specific prior written permission.
19662909a7SPeter Wemm.\"
20662909a7SPeter Wemm.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21662909a7SPeter Wemm.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22662909a7SPeter Wemm.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23662909a7SPeter Wemm.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24662909a7SPeter Wemm.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25662909a7SPeter Wemm.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26662909a7SPeter Wemm.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27662909a7SPeter Wemm.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28662909a7SPeter Wemm.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29662909a7SPeter Wemm.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30662909a7SPeter Wemm.\" SUCH DAMAGE.
31662909a7SPeter Wemm.\"
32662909a7SPeter Wemm.\"     @(#)kvm_getvfsbyname.3	8.3 (Berkeley) 5/4/95
33662909a7SPeter Wemm.\"
34662909a7SPeter Wemm.Dd May 4, 1995
35662909a7SPeter Wemm.Dt GETVFSBYNAME 3
36662909a7SPeter Wemm.Os
37662909a7SPeter Wemm.Sh NAME
38662909a7SPeter Wemm.Nm getvfsbyname
39662909a7SPeter Wemm.Nd get information about a filesystem
40662909a7SPeter Wemm.Sh SYNOPSIS
416d50b78dSBruce Evans.Fd #include <sys/param.h>
42662909a7SPeter Wemm.Fd #include <sys/mount.h>
43662909a7SPeter Wemm.Ft int
44662909a7SPeter Wemm.Fn getvfsbyname "const char *name" "struct vfsconf *vfc"
45662909a7SPeter Wemm.Sh DESCRIPTION
46662909a7SPeter WemmThe
47662909a7SPeter Wemm.Fn getvfsbyname
48662909a7SPeter Wemmfunction provides access to information about a
49662909a7SPeter Wemmfilesystem module that is configured in the kernel.
50662909a7SPeter WemmIf successful,
51662909a7SPeter Wemmthe requested filesystem
52662909a7SPeter Wemm.Fa vfsconf
53662909a7SPeter Wemmis returned in the location pointed to by
541d104f9fSMike Pritchard.Fa vfc .
55662909a7SPeter WemmThe fields in a
56662909a7SPeter Wemm.Dq Li struct vfsconf
57662909a7SPeter Wemmare defined as follows:
58662909a7SPeter Wemm.Pp
59662909a7SPeter Wemm.Bl -tag -compact -width vfc_refcount
60662909a7SPeter Wemm.It vfc_name
61662909a7SPeter Wemmthe name of the filesystem
62662909a7SPeter Wemm.It vfc_typenum
63662909a7SPeter Wemmthe filesystem type number assigned by the kernel
64662909a7SPeter Wemm.It vfc_refcount
65662909a7SPeter Wemmthe number of active mount points using the filesystem
66662909a7SPeter Wemm.It vfc_flags
67662909a7SPeter Wemmflag bits that are used to initialize a new mount point
68662909a7SPeter Wemmusing the filesystem
69662909a7SPeter Wemm.El
70662909a7SPeter Wemm.Sh RETURN VALUES
71662909a7SPeter WemmIf the call to
72662909a7SPeter Wemm.Nm getvfsbyname
73662909a7SPeter Wemmis successful, 0 is returned.
74662909a7SPeter WemmOtherwise \-1 is returned and
75662909a7SPeter Wemm.Va errno
76662909a7SPeter Wemmis set appropriately.
77662909a7SPeter Wemm.Sh ERRORS
78662909a7SPeter WemmThe following errors may be reported:
79662909a7SPeter Wemm.Bl -tag -width Er
80662909a7SPeter Wemm.It Bq Er EFAULT
81662909a7SPeter WemmThe
82662909a7SPeter Wemm.Fa vfc
83662909a7SPeter Wemmpointer contains an invalid address.
84662909a7SPeter Wemm.It Bq Er ENOENT
85662909a7SPeter WemmThe
86662909a7SPeter Wemm.Fa name
87662909a7SPeter Wemmspecifies a filesystem that is unknown or not configured in the kernel.
88662909a7SPeter Wemm.Sh SEE ALSO
89662909a7SPeter Wemm.Xr sysctl 1 ,
90662909a7SPeter Wemm.Xr mount 2 ,
91662909a7SPeter Wemm.Xr sysctl 3 ,
92662909a7SPeter Wemm.Xr mount 8
93662909a7SPeter Wemm.Sh HISTORY
94662909a7SPeter WemmA variant of the
95662909a7SPeter Wemm.Fn getvfsbyname
961d104f9fSMike Pritchardfunction first appeared in
971d104f9fSMike Pritchard.Fx 2.0 .
98