explain_statfs_or_die(3)

πŸ“¦
version 1.4.D001 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

✨ explain_statfs_or_die β€” Library Functions Manual ✨

okay bestie, welcome to explain_statfs_or_die(3) πŸ’… this is the libexplain page that lets you grab file system stats and get a whole explanation when things go sideways. no cap.


πŸŽ€ NAME πŸŽ€

explain_statfs_or_die β€” get file system statistics and report errors


🌸 SYNOPSIS 🌸

#include <libexplain/statfs.h>
void explain_statfs_or_die(const char *pathname, struct statfs *data);
int explain_statfs_on_error(const char *pathname, struct statfs *data);

πŸ’– DESCRIPTION πŸ’–

so the explain_statfs_or_die function is the one you call when you wanna invoke the statfs(2) system call. if it fails, an explanation gets printed to stderr β€” that explanation comes straight from the explain_statfs(3) function β€” and then your process literally ends by calling exit(EXIT_FAILURE). it's giving dramatic exit, but make it informative. πŸ’€

the explain_statfs_on_error function also calls the statfs(2) system call. if it fails, an explanation is printed to stderr, obtained from the explain_statfs(3) function too β€” but this one still returns to the caller. no dying, just vibes and info. πŸ¦‹

  • pathname β€” the pathname, exactly as to be passed to the statfs(2) system call. yes, exactly. don't get cute with it.
  • data β€” the data, exactly as to be passed to the statfs(2) system call. same energy, same rule.

πŸ‘‘ RETURN VALUE πŸ‘‘

the explain_statfs_or_die function only returns on success β€” check out statfs(2) for more info on that. on failure it prints an explanation and exits, so like… it does not return. periodt.

the explain_statfs_on_error function always returns the value returned by the wrapped statfs(2) system call. always. that's its whole thing. ✨


🌈 EXAMPLE 🌈

the explain_statfs_or_die function is intended to be used in a fashion similar to the following example:

explain_statfs_or_die(pathname, data);

πŸ”₯ SEE ALSO πŸ”₯


libexplain version 1.4 Copyright (C) 2009 Peter Miller


okay that's the whole page bestie, you're officially educated on explain_statfs_or_die(3) 🫢 this little baddie comes to you courtesy of libexplain version 1.4, with copyright (C) 2009 Peter Miller holding it down since way back β€” slay, and see you in the next manpage πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from