explain_raise_or_die(3)

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

πŸ’– explain_raise_or_die(3) πŸ’–

okay bestie, welcome to the Library Functions Manual entry for explain_raise_or_die β€” she's from libexplain and she's here to help you yeet a signal at yourself and tell you exactly why it went wrong. 🫢


✨ NAME ✨

explain_raise_or_die β€” send a signal to the caller and report errors


🌸 SYNOPSIS 🌸

#include <libexplain/raise.h>
void explain_raise_or_die(int sig);
int explain_raise_on_error(int sig);

πŸ¦‹ DESCRIPTION πŸ¦‹

So, the explain_raise_or_die function is used to call the raise(3) system call. And like… if it fails? An explanation gets printed to stderr, obtained from the explain_raise(3) function, and then the process terminates by calling exit(EXIT_FAILURE). It's giving "we're done here, no notes, no survivors." πŸ’€

The explain_raise_on_error function is also used to call the raise(3) system call. If it fails, an explanation will be printed to stderr, obtained from the explain_raise(3) function β€” but this one still returns to the caller. She's the chill sister. She tells you what happened and then lets you keep living your life. 🌈

  • sig β€” the sig, exactly as to be passed to the raise(3) system call. no remixing, no editing, just pass it through fr fr.

πŸ‘‘ RETURN VALUE πŸ‘‘

The explain_raise_or_die function only returns on success β€” see raise(3) for more information. On failure, it prints an explanation and exits, it does not return. like, at all. ever. gone. πŸ’…

The explain_raise_on_error function always returns the value return by the wrapped raise(3) system call. (yes, the original says "return" and honestly? we respect it. periodt.)


πŸŽ€ EXAMPLE πŸŽ€

The explain_raise_or_die function is intended to be used in a fashion similar to the following example:

explain_raise_or_die(sig);

iconic. flawless. ten out of ten, no notes. ⭐


πŸ”₯ SEE ALSO πŸ”₯


libexplain version 1.4 Copyright (C) 2009 Peter Miller


and that's the whole page bestie!! 🧚 this was explain_raise_or_die(3) from libexplain version 1.4, copyright Β© 2009 Peter Miller β€” go forth, raise your signals, and let libexplain hold your hand when it all goes sideways. mwah πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from