vfs_fstat(9)
π vfs_fstat π
okay bestie, welcome to the Kernel API Manual β¨ β this little cutie lives in section 9 and honestly she's giving "small but mighty." π
πΈ NAME πΈ
vfs_fstat β literally just Get the basic attributes by file descriptor π¦
β¨ SYNOPSIS β¨
int vfs_fstat (int fd , struct kstat *stat );
yes, that spacing is real, we don't fix what isn't broken π
π«Ά ARGUMENTS π«Ά
fdβ the file descriptor referring to the file of interest π like, which file are we talking about here, bestiestatβ the result structure to fill in. she comes empty, she leaves full of lore π
π DESCRIPTION π
so this function is a wrapper around vfs_getattr β same energy, slightly different outfit π
the main difference is that it uses a file descriptor to determine the file location. that's it, that's the whole glow-up β¨
0 will be returned on success π and a -ve error code if unsuccessful π (yes, negative, we love a dramatic exit).
ngl, if you see a negative number come back, something did NOT slay. check your fd, check your vibes π
π SEE ALSO π
- Kernel file
./fs/stat.c fill_mg_cmtime(9)generic_fillattr(9)generic_fill_statx_attr(9)generic_fill_statx_atomic_writes(9)vfs_getattr_nosec(9)vfs_statx(9)sys_statx(9)
go read those next, they're the friend group π«Ά iykyk
β okay that's the whole page, mwah β
signing off from ./fs π β version vibes: October 2026, no cap, and that's the whole vfs_fstat(9) moment ππ
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms