getvfsbyname(3)

getvfsbyname3

Get information about a file system

Usage

#include <sys/param.h>

#include <sys/mount.h>

int

getvfsbyname(const char *name, struct xvfsconf *vfc);

Library

Standard C Library (libc, -lc)

Overview

The getvfsbyname() function provides access to information about a file system module that is configured in the kernel. If successful, the requested file system xvfsconf is returned in the location pointed to by vfc. The fields in a “struct xvfsconf” are defined as follows:

vfc_name

the name of the file system

vfc_typenum

the file system type number assigned by the kernel

vfc_refcount

the number of active mount points using the file system

vfc_flags

flag bits, as described below

The flags are defined as follows:

VFCF_STATIC

statically compiled into kernel

VFCF_NETWORK

may get data over the network

VFCF_READONLY

writes are not implemented

VFCF_SYNTHETIC

data does not represent real files

VFCF_LOOPBACK

aliases some other mounted FS

VFCF_UNICODE

stores file names as Unicode

VFCF_JAIL

can be mounted from within a jail if allow.mount and allow.mount.<vfc_name> jail parameters are set

VFCF_DELEGADMIN

supports delegated administration if vfs.usermount sysctl is set to 1

Return values

The getvfsbyname() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

Errors

The following errors may be reported:

[ENOENT]

The name argument specifies a file system that is unknown or not configured in the kernel.

Releases

87 releases since FreeBSD 2.0.5-RELEASE; the text changed 49 times.

  1. 2.0.5
  2. 2.1.5–2.1.7.1
  3. 2.2.2–2.2.6
  4. 2.2.7–2.2.8
  5. 2.2.9
  6. 3.0–3.2
  7. 3.3–3.4
  8. 3.5–3.5.1
  9. 4.0
  10. 4.1–4.2
  11. 4.3
  12. 4.4
  13. 4.5–4.11
  14. 5.0
  15. 5.1–6.3
  16. 6.4
  17. 7.0
  18. 7.1
  19. 7.2
  20. 7.3
  21. 7.4
  22. 8.0
  23. 8.1
  24. 8.2
  25. 8.3
  26. 8.4
  27. 9.0
  28. 9.1
  29. 9.2
  30. 9.3
  31. 10.0
  32. 10.1
  33. 10.2
  34. 10.3
  35. 10.4
  36. 11.0
  37. 11.1
  38. 11.2
  39. 11.3
  40. 11.4
  41. 12.0
  42. 12.1
  43. 12.2
  44. 12.3
  45. 12.4
  46. 13.0–13.2
  47. 13.3–14.3
  48. 14.4–14.5
  49. 15.0
  50. 15.1–16.0

History

A variant of the getvfsbyname() function first appeared in FreeBSD 2.0.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.