EXPLAIN_TCGETATTR_OR_DIE(3)

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

πŸ’– 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 β€” The fildes, exactly as to be passed to the tcgetattr(3) system call. like, verbatim, no edits, no notes. ✨
  • data β€” The data, exactly as to be passed to the tcgetattr(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 πŸŽ€


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