explain_tc...eak_or_die(3)
β¨ explain_tcsendbreak_or_die(3) β¨
okay so bestie, we're in the Library Functions Manual today and this one is literally about sending a terminal line break and then being so dramatic about errors π
πΈ NAME πΈ
explain_tcsendbreak_or_die β send terminal line break and report errors
π SYNOPSIS π
#include <libexplain/tcsendbreak.h>
void explain_tcsendbreak_or_die(int fildes, int duration);
int explain_tcsendbreak_on_error(int fildes, int duration);
π¦ DESCRIPTION π¦
so there's these two functions and they're basically twins but with wildly different energy on failure, k?
The explain_tcsendbreak_or_die function is used to call the tcsendbreak(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_tcsendbreak(3) function, and then the process terminates by calling exit(EXIT_FAILURE). yeah. it just ends you. no cap. π
The explain_tcsendbreak_on_error function is used to call the tcsendbreak(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_tcsendbreak(3) function, but still returns to the caller. see? chill vibes. it tells you what went wrong and then lets you keep living π«Ά
fildesβ Thefildes, exactly as to be passed to thetcsendbreak(3)system call. no notes, no changes, just pass it straight through β¨durationβ Theduration, exactly as to be passed to thetcsendbreak(3)system call. same deal bestie, hand it over untouched π
π RETURN VALUE π
The explain_tcsendbreak_or_die function only returns on success, see tcsendbreak(3) for more information. On failure, prints an explanation and exits, it does not return. like... it's not coming back. that's the whole bit. π
The explain_tcsendbreak_on_error function always returns the value return by the wrapped tcsendbreak(3) system call. always. every time. it's giving reliable π
π EXAMPLE π
The explain_tcsendbreak_or_die function is intended to be used in a fashion similar to the following example:
explain_tcsendbreak_or_die(fildes, duration);
that's it, that's the whole vibe. iconic honestly β
π SEE ALSO π
tcsendbreak(3)β send terminal line breakexplain_tcsendbreak(3)β explaintcsendbreak(3)errorsexit(2)β terminate the calling process
π§ COPYRIGHT π§
libexplain version 1.4 Copyright (C) 2009 Peter Miller
and that's the page bestie!! libexplain version 1.4, Copyright (C) 2009 Peter Miller β go forth and send those terminal line breaks 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) 2009, 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms