explain_nice_or_die(3)
π
explain_nice_or_die(3) β the libexplain girlies' guide
okay bestie, sit DOWN, we're talking about explain_nice_or_die(3) from the Library Functions Manual and honestly? it's giving "I change your process priority and I will tell you when it goes wrong." π
β¨ NAME β¨
explain_nice_or_die β change process priority and report errors. that's it, that's the whole job. she adjusts your niceness and she is not subtle about it π
π¦ SYNOPSIS π¦
#include <libexplain/nice.h>
int explain_nice_or_die(int inc);
int explain_nice_on_error(int inc);
yes she comes with two flavours, like a duo, like a matching set, we love to see it πΈ
π DESCRIPTION π
okay so. here's the tea π
The explain_nice_or_die function is used to call the nice(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_nice(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
translating from manpage-ese: she does the thing, and if the thing fails, she prints a whole explanation tostderrand then literally ends your process viaexit(EXIT_FAILURE). no coming back. main character exits, periodt π
The explain_nice_on_error function is used to call the nice(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_nice(3) function, but still returns to the caller.
so yeah β same energy, same explanation to stderr, but this one stays. she tells you what went wrong and then hands the control right back to you, like the supportive bestie she is π«Ά
π the argument π
incβ theinc, exactly as to be passed to thenice(2)system call. like, word for word, no edits, no remixing, no "I thought this would be better" β she passes it through exactly as you gave it π
β RETURN VALUE β
The explain_nice_or_die function only returns on success, see nice(2) for more information. On failure, prints an explanation and exits, it does not return.
so if you ever see her come back?? that means you WON. success only. on failure she's already gone, printing receipts on her way out π
The explain_nice_on_error function always returns the value return by the wrapped nice(2) system call.
no drama, no exit, just the value, every single time β¨
π§ EXAMPLE π§
The explain_nice_or_die function is intended to be used in a fashion similar to the following example:
int result = explain_nice_or_die(inc);
that's it. that's the whole vibe. look how clean, look how crisp ππ
π₯ SEE ALSO π₯
nice(2)β change process priorityexplain_nice(3)β explainnice(2)errorsexit(2)β terminate the calling process
the whole friend group, all linked up, iykyk π
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2009 Peter Miller
and that's the page bestie!! go forth, change your process priority, and may your inc always be accepted ππ
okay love you, bye β this was explain_nice_or_die(3) from the Library Functions Manual, libexplain version 1.4, Copyright (C) 2009 Peter Miller. mwah πβ¨
π¦ 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