xref: /original-bsd/lib/libc/gen/getvfsbyname.3 (revision 4e8da28c)
1.\" Copyright (c) 1995
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)getvfsbyname.3	8.3 (Berkeley) 05/04/95
7.\"
8.Dd
9.Dt GETVFSBYNAME 3
10.Os
11.Sh NAME
12.Nm getvfsbyname
13.Nd get information about a filesystem
14.Sh SYNOPSIS
15.Fd #include <sys/types.h>
16.Fd #include <sys/mount.h>
17.Fd #include <kvm.h>
18.br
19.Ft int
20.Fn getvfsbyname "const char *name" "struct vfsconf *vfc"
21.Sh DESCRIPTION
22The
23.Fn getvfsbyname
24function provides access to information about a
25filesystem module that is configured in the kernel.
26If successful,
27the requested filesystem
28.Fa vfsconf
29is returned in the location pointed to by
30.Nm vfc .
31The fields in a
32.Dq Li struct vfsconf
33are defined as follows:
34.Pp
35.Bl -tag -compact -width vfc_refcount
36.It vfc_name
37the name of the filesystem
38.It vfc_typenum
39the filesystem type number assigned by the kernel
40.It vfc_refcount
41the number of active mount points using the filesystem
42.It vfc_flags
43flag bits that are used to initialize a new mount point
44using the filesystem
45.El
46.Sh RETURN VALUES
47If the call to
48.Nm getvfsbyname
49is successful, 0 is returned.
50Otherwise \-1 is returned and
51.Va errno
52is set appropriately.
53.Sh ERRORS
54The following errors may be reported:
55.Bl -tag -width Er
56.It Bq Er EFAULT
57The
58.Fa vfc
59pointer contains an invalid address.
60.It Bq Er ENOENT
61The
62.Fa name
63specifies a filesystem that is unknown or not configured in the kernel.
64.Sh SEE ALSO
65.Xr sysctl 1 ,
66.Xr mount 2 ,
67.Xr sysctl 3 ,
68.Xr mount 8
69.Sh HISTORY
70A variant of the
71.Fn getvfsbyname
72function first appeared in FreeBSD 2.0.
73