GETVFSBYNAME(3)
π
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 ifallow.mountandallow.mount.<vfc_name>jail parameters are set πVFCF_DELEGADMINβ supports delegated administration ifvfs.usermountsysctl is set to1π
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, the0/-1return,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
- Copyright (c) 1995 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms