explain_fstatvfs_or_die(3)
π explain_fstatvfs_or_die β Library Functions Manual π
okay bestie, so we're in the explain_fstatvfs_or_die(3) page and it's giving "get file system statistics and report errors" energy. iconic. let's go π«Ά
β¨ NAME β¨
explain_fstatvfs_or_die β get file system statistics and report errors
πΈ SYNOPSIS πΈ
#include <libexplain/fstatvfs.h>
void explain_fstatvfs_or_die(int fildes, struct statvfs *data);
int explain_fstatvfs_on_error(int fildes, struct statvfs *data);
π¦ DESCRIPTION π¦
so the explain_fstatvfs_or_die function? it's literally there to call the fstatvfs(2) system call. but here's the tea β β if it fails, an explanation gets printed to stderr, and that explanation comes from the explain_fstatvfs(3) function. and then, bestie, the process terminates by calling exit(EXIT_FAILURE). no coming back from that one π periodt.
and then there's explain_fstatvfs_on_error, which is the more chill sibling π. it also calls the fstatvfs(2) system call, and on failure it also prints an explanation to stderr obtained from the explain_fstatvfs(3) function β but it still returns to the caller. lowkey the polite version fr fr.
Now the args, because you gotta know what you're feeding it:
fildesβ thefildes, exactly as to be passed to thefstatvfs(2)system call. like, no edits, no remix, pass it through as-is β¨dataβ thedata, exactly as to be passed to thefstatvfs(2)system call. same deal, verbatim, don't touch it π
π RETURN VALUE π
the explain_fstatvfs_or_die function only returns on success, and if you wanna know more, go peek at fstatvfs(2). on failure? it prints an explanation and exits β it does not return. like, at all. it said bye ππ
the explain_fstatvfs_on_error function always returns the value returned by the wrapped fstatvfs(2) system call. always. consistent queen π
π EXAMPLE π
the explain_fstatvfs_or_die function is intended to be used in a fashion similar to the following example:
explain_fstatvfs_or_die(fildes, data);
that's it. that's the vibe. simple, clean, slays π₯
π SEE ALSO π
fstatvfs(2)β get file system statisticsexplain_fstatvfs(3)β explainfstatvfs(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2010 Peter Miller
and that's the whole page bestie, no cap π§β¨ this was explain_fstatvfs_or_die(3) from the Library Functions Manual, brought to you by libexplain version 1.4 and the one and only Peter Miller, copyright 2010 β mwah, go forth and stat those file systems ππΈπ¦
π¦ where this page comes from
- debian bookworm: libexplain-dev 1.4.D001-12+b1 Β· LGPL-3.0-or-later
- debian trixie: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- ubuntu jammy: libexplain-dev 1.4.D001-12 Β· LGPL-3.0-or-later
- ubuntu noble: libexplain-dev 1.4.D001-13 Β· LGPL-3.0-or-later
- ubuntu resolute: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- Copyright (C) 2010, 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms