explain_se...ity_or_die(3)
β¨ NAME β¨</p>
explain_setpriority_or_die β bestie, this is the one that sets your program's scheduling priority and then tells you exactly what went wrong if it can't. π
πΈ SYNOPSIS πΈ
#include <libexplain/setpriority.h>
void explain_setpriority_or_die(int which, int who, int prio);
int explain_setpriority_on_error(int which, int who, int prio);
π¦ DESCRIPTION π¦
okay so listen. π There are two functions here and they're sisters, not twins.
explain_setpriority_or_die
This one is the main character. It calls the setpriority(2) system call for you. If everything goes right, slay, we move. But if it fails? An explanation gets printed to stderr, and that explanation comes from the explain_setpriority(3) function, and then the process terminates by calling exit(EXIT_FAILURE). Like, it does not come back. It's giving dramatic exit. π
explain_setpriority_on_error
This one is the chill sister. It also calls setpriority(2). If it fails, an explanation is printed to stderr (again obtained from the explain_setpriority(3) function) β but then it still returns to the caller. No exit, no drama, just vibes and a returned error. π«Ά
The arguments, babes
whichβ thewhich, exactly as to be passed to thesetpriority(2)system call. No edits, no notes, just pass it through.whoβ thewho, exactly as to be passed to thesetpriority(2)system call. Same deal.prioβ theprio, exactly as to be passed to thesetpriority(2)system call. You already know. β¨
π RETURN VALUE π
explain_setpriority_or_die β bestie, it only returns on success. That's it. See setpriority(2) for more info if you're curious. On failure it prints an explanation and exits β it does not return. Ever. Periodt. π
explain_setpriority_on_error β this one always returns the value returned by the wrapped setpriority(2) system call. Always. Every time. Iconic behaviour honestly.
π EXAMPLE π
The explain_setpriority_or_die function is intended to be used in a fashion similar to the following example:
explain_setpriority_or_die(which, who, prio);
that's it. that's the whole vibe. πΈ
π SEE ALSO π
setpriority(2)β set program scheduling priorityexplain_setpriority(3)β explainsetpriority(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2013 Peter Miller
okay that's the whole page, bestie!! π¦β¨ this one lives in the Library Functions Manual and it's explain_se...ity_or_die(3) β go forth and set those priorities responsibly, 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