EXPLAIN_TCGETATTR_OR_DIE(3)
π explain_tcgetattr_or_die(3) π
okay bestie, you found the page for explain_tcgetattr_or_die β it lives in the Library Functions Manual, and it's literally the glow-up version of calling tcgetattr(3) that also tells you why things went wrong. no cryptic silence, no mystery. we communicate here. π
β¨ NAME β¨
explain_tcgetattr_or_die β get terminal parameters and report errors
πΈ SYNOPSIS πΈ
#include <libexplain/tcgetattr.h>
void explain_tcgetattr_or_die(int fildes, struct termios *data);
int explain_tcgetattr_on_error(int fildes, struct termios *data);
π¦ DESCRIPTION π¦
so here's the tea, bestie. π
The explain_tcgetattr_or_die function is used to call the tcgetattr(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_tcgetattr(3) function, and then the process terminates by calling exit(EXIT_FAILURE). yeah. it's giving dramatic exit. it does not come back. π
The explain_tcgetattr_on_error function is used to call the tcgetattr(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_tcgetattr(3) function, but still returns to the caller. so this one is the chill sibling β it tells you what happened and then hands the control back. π«Ά
fildesβ Thefildes, exactly as to be passed to thetcgetattr(3)system call. like, verbatim, no edits, no notes. β¨dataβ Thedata, exactly as to be passed to thetcgetattr(3)system call. same energy. π
π RETURN VALUE π
The explain_tcgetattr_or_die function only returns on success, see tcgetattr(3) for more information. On failure, prints an explanation and exits, it does not return. it's gone. it left. no goodbye text. π
The explain_tcgetattr_on_error function always returns the value return by the wrapped tcgetattr(3) system call. every single time. reliable queen. π
π EXAMPLE π
The explain_tcgetattr_or_die function is intended to be used in a fashion similar to the following example:
explain_tcgetattr_or_die(fildes, data);
that's it. that's the whole vibe. call it, and if the terminal params refuse to cooperate, you get the full story before the process dips. β¨
π SEE ALSO π
tcgetattr(3)β get terminal parametersexplain_tcgetattr(3)β explaintcgetattr(3)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2009 Peter Miller
okay that's the whole page bestie, mwah π«Ά this was libexplain version 1.4, copyright Copyright (C) 2009 Peter Miller, and the man page is literally called explain_tcgetattr_or_die(3) β periodt. π
β¨
π¦ 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