sys_statvfs.h(0P)
π sys_statvfs.h β VFS File System information structure π
okay bestie, welcome to the <sys/statvfs.h> glow-up β¨ this is the header that spills all the tea about your file system's vibe β how big the blocks are, how many are free, who's allowed to touch what. it's giving "filesystem receipts" and honestly? iconic. it lives in the POSIX Programmer's Manual (that's sys_statvfs.h(0P), for the record π).
πΈ PROLOG πΈ
so like, real talk before we dive in: this manual page is part of the POSIX Programmer's Manual. but heads up babes β the Linux implementation of this interface may differ (so go check the corresponding Linux manual page for the deets on Linux behavior), or the interface might not even be implemented on Linux at all π. no cap, always double-check.
β¨ NAME β¨
sys/statvfs.h β VFS File System information structure π¦
π«Ά SYNOPSIS π«Ά
#include <sys/statvfs.h>
that's it. that's the whole vibe. one include and you're in π
π DESCRIPTION π
okay so the <sys/statvfs.h> header shall define the statvfs structure, and that struct has to include at least these members (yes, at least β there could be more, main character energy):
unsigned long f_bsize File system block size.
unsigned long f_frsize Fundamental file system block size.
fsblkcnt_t f_blocks Total number of blocks on file system in units of f_frsize.
fsblkcnt_t f_bfree Total number of free blocks.
fsblkcnt_t f_bavail Number of free blocks available to
non-privileged process.
fsfilcnt_t f_files Total number of file serial numbers.
fsfilcnt_t f_ffree Total number of free file serial numbers.
fsfilcnt_t f_favail Number of file serial numbers available to
non-privileged process.
unsigned long f_fsid File system ID.
unsigned long f_flag Bit mask of f_flag values.
unsigned long f_namemax Maximum filename length.
f_bsizeβ file system block size, literally the size of a block πf_frsizeβ the fundamental file system block size, the base unit of the whole operationf_blocksβ total blocks on the file system, measured in units off_frsizef_bfreeβ total free blocksf_bavailβ free blocks available to a non-privileged process (so like, not root)f_filesβ total number of file serial numbersf_ffreeβ total free file serial numbersf_favailβ file serial numbers available to a non-privileged processf_fsidβ the file system ID, its little name tag π·οΈf_flagβ a bit mask off_flagvaluesf_namemaxβ the maximum filename length, so you know how long you can go before it's too much π
also, the <sys/statvfs.h> header shall define the fsblkcnt_t and fsfilcnt_t types, exactly as described in <sys/types.h>.
and it shall define these symbolic constants for the f_flag member:
ST_RDONLYβ read-only file system. look but don't touch, periodt π«βST_NOSUIDβ does not support the semantics of theST_ISUIDandST_ISGIDfile mode bits.
these next ones shall be declared as functions and may also be defined as macros. function prototypes shall be provided:
int fstatvfs(int, struct statvfs *);
int statvfs(const char *restrict, struct statvfs *restrict);
ngl the following sections are marked as informative β so they're not the binding part, they're just the commentary track π§
π APPLICATION USAGE π
None. (yes fr, nothing here. it said what it said π)
π RATIONALE π
None. (again β zero notes, the standard was feeling mysterious β¨)
π FUTURE DIRECTIONS π
None. (no glow-up planned, the future is now bestie π )
β SEE ALSO β
<sys_types.h>- The System Interfaces volume of POSIX.1β2017,
fstatvfs()
π₯ COPYRIGHT π₯
okay legal bestie, we gotta do this part properly, no skipping π«Ά
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page bestie!! π¦β¨ this icon was brought to you by IEEE/The Open Group, circa 2017 β yeah she's been on the scene a minute but she still eats π π mwah, go check your filesystem stats, ily π«Ά
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms