explain_acct_or_die(3)

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

πŸ’– explain_acct_or_die β€” the libexplain era πŸ’–

okay so bestie, welcome to explain_acct_or_die(3), a Library Functions Manual entry, section 3, and it's literally the friendliest way to flip process accounting on or off and get a whole explanation when it goes sideways πŸŽ€


✨ NAME ✨

explain_acct_or_die β€” switch process accounting on or off and report errors πŸ¦‹


🌸 SYNOPSIS 🌸

#include <libexplain/acct.h>
void explain_acct_or_die(const char *pathname);
int explain_acct_on_error(const char *pathname))
yes the double )) at the end of that second line is exactly how it's written in the manual, no cap, we do not touch it πŸ’…

πŸ’… DESCRIPTION πŸ’…

So the explain_acct_or_die function is here to call the acct(2) system call for you. And when it fails? It prints an explanation to stderr, grabbed from the explain_acct(3) function, and then the process terminates by calling exit(EXIT_FAILURE). like, it's not coming back. bye πŸ‘‹

The explain_acct_on_error function also calls the acct(2) system call. On failure it prints an explanation to stderr too, obtained from the explain_acct(3) function, but β€” plot twist β€” it still returns to the caller 🫢

pathname πŸ“

The pathname, exactly as to be passed to the acct(2) system call. no editing, no remixing, just hand it over as-is bestie ✨


πŸ‘‘ RETURN VALUE πŸ‘‘

The explain_acct_or_die function only returns on success β€” see acct(2) for more info. On failure, it prints an explanation and exits, it does not return. gone. poof. main character exit 😭

The explain_acct_on_error function always returns the value return by the wrapped acct(2) system call πŸ’œ


🌈 EXAMPLE 🌈

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

explain_acct_or_die(pathname);

that's it. that's the whole vibe. iconic ✨


πŸ¦‹ SEE ALSO πŸ¦‹


libexplain version 1.4 Copyright (C) 2009 Peter Miller


okay bestie that's the whole page πŸ’– shoutout to libexplain version 1.4 and Peter Miller, copyright 2009, for making explain_acct_or_die(3) a real thing that exists, and big love from the Library Functions Manual, section 3 β€” mwah, go forth and account responsibly 🌸✨

πŸ“¦ where this page comes from