xref: /freebsd/lib/libc/gen/getvfsbyname.3 (revision 5e3190f700637fcfc1a52daeaa4a031fdd2557c7)
1.\" Copyright (c) 1995
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     @(#)kvm_getvfsbyname.3	8.3 (Berkeley) 5/4/95
29.\"
30.Dd August 16, 2018
31.Dt GETVFSBYNAME 3
32.Os
33.Sh NAME
34.Nm getvfsbyname
35.Nd get information about a file system
36.Sh LIBRARY
37.Lb libc
38.Sh SYNOPSIS
39.In sys/param.h
40.In sys/mount.h
41.Ft int
42.Fn getvfsbyname "const char *name" "struct xvfsconf *vfc"
43.Sh DESCRIPTION
44The
45.Fn getvfsbyname
46function provides access to information about a
47file system module that is configured in the kernel.
48If successful,
49the requested file system
50.Fa xvfsconf
51is returned in the location pointed to by
52.Fa vfc .
53The fields in a
54.Dq Li struct xvfsconf
55are defined as follows:
56.Pp
57.Bl -tag -compact -width vfc_refcount
58.It vfc_name
59the name of the file system
60.It vfc_typenum
61the file system type number assigned by the kernel
62.It vfc_refcount
63the number of active mount points using the file system
64.It vfc_flags
65flag bits, as described below
66.El
67.Pp
68The flags are defined as follows:
69.Pp
70.Bl -tag -width VFCF_DELEGADMIN -compact
71.It Dv VFCF_STATIC
72statically compiled into kernel
73.It Dv VFCF_NETWORK
74may get data over the network
75.It Dv VFCF_READONLY
76writes are not implemented
77.It Dv VFCF_SYNTHETIC
78data does not represent real files
79.It Dv VFCF_LOOPBACK
80aliases some other mounted FS
81.It Dv VFCF_UNICODE
82stores file names as Unicode
83.It Dv VFCF_JAIL
84can be mounted from within a jail if
85.Va allow.mount
86and
87.Va allow.mount.<vfc_name>
88jail parameters are set
89.It Dv VFCF_DELEGADMIN
90supports delegated administration if
91.Va vfs.usermount
92sysctl is set to
93.Dv 1
94.El
95.Sh RETURN VALUES
96.Rv -std getvfsbyname
97.Sh ERRORS
98The following errors may be reported:
99.Bl -tag -width Er
100.It Bq Er ENOENT
101The
102.Fa name
103argument
104specifies a file system that is unknown or not configured in the kernel.
105.El
106.Sh SEE ALSO
107.Xr jail 2 ,
108.Xr mount 2 ,
109.Xr sysctl 3 ,
110.Xr jail 8 ,
111.Xr mount 8 ,
112.Xr sysctl 8
113.Sh HISTORY
114A variant of the
115.Fn getvfsbyname
116function first appeared in
117.Fx 2.0 .
118