explain_ge...ity_or_die(3)
π explain_getpriority_or_die β the group chat manual (3) π
okay so bestie, welcome to the explain_ge...ity_or_die(3) page, filed under Library Functions Manual and living rent-free in your terminal. it's giving "short but mighty" and honestly? we're obsessed. π
β¨ NAME β¨
explain_getpriority_or_die β get program scheduling priority and report errors π¦
β¨ SYNOPSIS β¨
#include <libexplain/getpriority.h>
int explain_getpriority_or_die(int which, int who);
int explain_getpriority_on_error(int which, int who);
two icons, one header file. slay. β¨
β¨ DESCRIPTION β¨
so, explain_getpriority_or_die is the bestie that calls the getpriority(2) system call for you. but here's the tea β β if it fails, it prints an explanation to stderr, grabbed straight from the explain_getpriority(3) function, and then the process terminates by calling exit(EXIT_FAILURE). like, it does not come back. it's gone. periodt. π
meanwhile explain_getpriority_on_error is the softer sibling πΈ β it also calls getpriority(2), and on failure it also prints an explanation to stderr (same source, explain_getpriority(3)), BUT it still returns to the caller. no dramatic exit. it stays. π«Ά
now the arguments, because we don't gatekeep:
whichβ the which, exactly as to be passed to thegetpriority(2)system call. yes literally exactly. don't get creative. πwhoβ the who, exactly as to be passed to thegetpriority(2)system call. same energy. exactly. π
β¨ RETURN VALUE β¨
explain_getpriority_or_die only returns on success β see getpriority(2) for more info. on failure? it prints an explanation and exits. it does not return. not even a little. π
explain_getpriority_on_error always returns the value returned by the wrapped getpriority(2) system call. always. every time. π
β¨ EXAMPLE β¨
explain_getpriority_or_die is intended to be used in a fashion similar to the following example:
int result = explain_getpriority_or_die(which, who);
that's it. that's the whole vibe. copy it, ship it, main character energy. π
β¨ SEE ALSO β¨
getpriority(2)β get program scheduling priority πexplain_getpriority(3)β explaingetpriority(2)errors π₯exit(2)β terminate the calling process π
β¨ COPYRIGHT β¨
libexplain version 1.4 Copyright (C) 2013 Peter Miller
and that's the whole page, bestie π this was explain_ge...ity_or_die(3) from Library Functions Manual, brought to you by libexplain version 1.4, Copyright (C) 2013 Peter Miller β ily, go call getpriority(2) responsibly, and don't forget to vibe check your which and who before you pass them. 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) 2013 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms