explain_acct_or_die(3)
π 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 π¦
acct(2)switch process accounting on or offexplain_acct(3)β explainacct(2)errorsexit(2)terminate the calling process
π COPYRIGHT π
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
- 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