explain_fstatvfs_or_die(3)

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

πŸ’– 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 β€” the fildes, exactly as to be passed to the fstatvfs(2) system call. like, no edits, no remix, pass it through as-is ✨
  • data β€” the data, exactly as to be passed to the fstatvfs(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 statistics
  • explain_fstatvfs(3) β€” explain fstatvfs(2) errors
  • exit(2) β€” terminate the calling process

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