GETVFSBYNAME(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… GETVFSBYNAME(3) β€” the girlies' guide to getvfsbyname

ok so bestie, this one's a Library Functions Manual page (the 3 means section 3 of the manual β€” library calls, iykyk), and honestly? it's a lil' cutie. it's the function that tells you everything about a file system module that's already living in your kernel. no cap. let's get into it ✨


✨ NAME ✨

getvfsbyname β€” get information about a file system πŸ—‚οΈ


πŸŽ€ LIBRARY πŸŽ€

Standard C Library (libc, -lc) β€” so you link it like -lc, standard behaviour, nothing spicy 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sys/param.h>
#include <sys/mount.h>

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

yes bestie, both includes. both. don't try to be cute and skip one πŸ’€


πŸ’– DESCRIPTION πŸ’–

okay so the getvfsbyname() function is basically a little info desk for file systems πŸ’… it gives you access to information about a file system module that is configured in the kernel. if it works? you get the file system you asked for as an xvfsconf, dropped right into the location that vfc points to. slay.

the fields in a β€œstruct xvfsconf” are defined like this:

  • 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 ⬇️

and the flags are defined like this:

  • 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 πŸ‘‘

like, look at all those flags. main character energy, every single one 🌈


πŸ”₯ RETURN VALUES πŸ”₯

getvfsbyname() returns the value 0 if successful πŸ’– otherwise the value -1 is returned and the global variable errno is set to indicate the error. classic. (if it was -1, go read errno, bestie, don't just stare at it 😭)


πŸ’€ ERRORS πŸ’€

the following errors may be reported:

  • [ENOENT] β€” the name argument specifies a file system that is unknown or not configured in the kernel. so like... it's not here, babe. it was never here 🫠

πŸ‘‘ SEE ALSO πŸ‘‘

lsvfs(1), jail(2), mount(2), sysctl(3), jail(8), mount(8), sysctl(8)


🌸 HISTORY 🌸

a variant of the getvfsbyname() function first appeared in FreeBSD 2.0 πŸ“œ a true elder. an icon. we respect her 🫢


🧚 little reminder bestie: everything above is exactly what the page says β€” the flags, the struct fields, the 0 / -1 return, errno, [ENOENT], every one of those SEE ALSO entries. i'm not making any of it up, i just made it cute πŸ’œ

okay that's the whole page!! this one was written by the Debian peeps and dated October 28, 2025 β€” so like, shoutout Debian, shoutout October 2025, shoutout libc section 3, we love a documented file system info desk πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms