explain_fstatfs_or_die(3)
β¨ explain_fstatfs_or_die(3) β¨
okay so bestie, buckle up, this is a page from the Library Functions Manual and it's literally all about grabbing file system stats and then being super dramatic when things go wrong. π
π NAME π
explain_fstatfs_or_die β get file system statistics and report errors π¦
πΈ SYNOPSIS πΈ
#include <libexplain/fstatfs.h>
void explain_fstatfs_or_die(int fildes, struct statfs *data);
int explain_fstatfs_on_error(int fildes, struct statfs *data);
π DESCRIPTION π
so there's these two functions and they're basically the same vibe, except one of them is a main character who cannot handle failure and the other one is chill about it. π
The explain_fstatfs_or_die function is used to call the fstatfs(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_fstatfs(3) function, and then the process terminates by calling exit(EXIT_FAILURE). π like, it does not come back. it's giving "we die like men". periodt.
The explain_fstatfs_on_error function is used to call the fstatfs(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_fstatfs(3) function, but still returns to the caller. so it tells you what went wrong and then just... hands you back the L and lets you keep going. iconic behavior honestly. π«Ά
fildesβ The fildes, exactly as to be passed to thefstatfs(2)system call. no notes, no changes, hand it over exactly like that fr fr.dataβ The data, exactly as to be passed to thefstatfs(2)system call. same deal, verbatim, don't be weird about it. β¨
π RETURN VALUE π
The explain_fstatfs_or_die function only returns on success, see fstatfs(2) for more information. On failure, prints an explanation and exits, it does not return. like at all. never. π
The explain_fstatfs_on_error function always returns the value return by the wrapped fstatfs(2) system call. so you always get something back, bestie. π
π§ EXAMPLE π§
The explain_fstatfs_or_die function is intended to be used in a fashion similar to the following example:
explain_fstatfs_or_die(fildes, data);
that's it. that's the whole vibe. lowkey gorgeous. πΈ
β SEE ALSO β
fstatfs(2)β get file system statisticsexplain_fstatfs(3)β explainfstatfs(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2009 Peter Miller
okay that's the whole page bestie, go forth and get those file system statistics responsibly π¦β¨ and yeah β this was explain_fstatfs_or_die(3) from the Library Functions Manual, running libexplain version 1.4, with the copyright sitting pretty at Copyright (C) 2009 Peter Miller. love that for us. no cap. ππ
π¦ 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) 2009, 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms