explain_tc...eak_or_die(3)

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

✨ 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 β€” The fildes, exactly as to be passed to the tcsendbreak(3) system call. no notes, no changes, just pass it straight through ✨
  • duration β€” The duration, exactly as to be passed to the tcsendbreak(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 πŸ’œ


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