explain_ge...ity_or_die(3)

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

πŸ’– 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 the getpriority(2) system call. yes literally exactly. don't get creative. πŸŽ€
  • who β€” the who, exactly as to be passed to the getpriority(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 ✨


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