explain_puts_or_die(3)
π explain_puts_or_die(3) π
okay bestie, welcome to the Library Functions Manual section for explain_puts_or_die(3) β yes the whole page is named after it, no it's not a typo, we're literally in her era β¨
πΈ NAME πΈ
explain_puts_or_die β write a string and a newline to stdout and report errors. that's it. that's the job. and she does it flawlessly π
β¨ SYNOPSIS β¨
okay so first you gotta let the compiler know she exists:
#include <libexplain/puts.h>
void explain_puts_or_die(const char *s);
int explain_puts_on_error(const char *s);
two icons, two vibes, one header file. periodt π
π¦ DESCRIPTION π¦
so, the tea:
explain_puts_or_die is used to call the puts(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_puts(3) function, and then the process terminates by calling exit(EXIT_FAILURE). so likeβ¦ she either eats, or she exits. no in-between, no negotiation, main character energy fr fr π
explain_puts_on_error is also used to call the puts(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_puts(3) function, but still returns to the caller. she's the chill one. she tells you what went wrong and then lets you keep living your life π«Ά
sβ thes, exactly as to be passed to theputs(3)system call. don't get creative with it bestie, she wants it verbatim, no cap π₯
π RETURN VALUE π
explain_puts_or_die only returns on success, see puts(3) for more information. On failure, prints an explanation and exits, it does not return. like, genuinely does not come back. the door is closed. the lights are off. it's giving goodbye π
explain_puts_on_error always returns the value return by the wrapped puts(3) system call. lowkey the reliable bestie of the two πΈ
π EXAMPLE π
explain_puts_or_die is intended to be used in a fashion similar to the following example:
explain_puts_or_die(s);
that's the whole thing. one line. iconic. she ate and left no crumbs β¨π
π SEE ALSO π
puts(3)β write a string and a trailing newline tostdoutexplain_puts(3)β explainputs(3)errorsexit(2)β terminate the calling process
go read them, iykyk, they're all part of the same little family π§
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2009 Peter Miller
okay bestie that's the whole page π this was explain_puts_or_die(3) from libexplain version 1.4, copyrighted 2009 by Peter Miller, hanging out at the bottom of the page like the little footer she is β go forth, call puts(3), and may your stdout always be flush and your errors always explained π
π¦ 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