explain_tcflow_or_die(3)
π explain_tcflow_or_die β from the Library Functions Manual β¨
okay bestie, pull up a chair, we're doing a 3 page here (that's a library functions manual page, iykyk) and it's all about terminal flow control plus reporting errors like a main character. let's get into it π«Ά
β¨ NAME β¨
explain_tcflow_or_die β terminal flow control and report errors π
π¦ SYNOPSIS π¦
#include <libexplain/tcflow.h>
void explain_tcflow_or_die(int fildes, int action);
int explain_tcflow_on_error(int fildes, int action);
πΈ DESCRIPTION πΈ
so, explain_tcflow_or_die is the function you call when you wanna hit up the tcflow(3) system call. if it fails? an explanation gets printed to stderr, and that explanation comes from the explain_tcflow(3) function. and then β and this is the dramatic part β the process terminates by calling exit(EXIT_FAILURE). it's giving "we don't do half measures" π
explain_tcflow_on_error is the chill sibling. it also calls the tcflow(3) system call, and on failure it also prints an explanation to stderr (again, obtained from the explain_tcflow(3) function), but it still returns to the caller. no exit, no drama, just vibes and a returned error. π§
fildesβ the fildes, exactly as to be passed to thetcflow(3)system call. no notes, pass it exactly. β¨actionβ the action, exactly as to be passed to thetcflow(3)system call. same energy, exactly as-is. π
π RETURN VALUE π
explain_tcflow_or_die only returns on success β for more info, go look at tcflow(3). on failure it prints an explanation and exits, so likeβ¦ it does not return. periodt. π
explain_tcflow_on_error always returns the value return by the wrapped tcflow(3) system call. (yes, "return by", that's how the page says it, we keep it π)
π EXAMPLE π
the explain_tcflow_or_die function is intended to be used in a fashion similar to the following example:
explain_tcflow_or_die(fildes, action);
that's it, that's the whole vibe. iconic. π₯
π SEE ALSO π
tcflow(3)β terminal flow controlexplain_tcflow(3)β explaintcflow(3)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2009 Peter Miller
okay that's the whole page, bestie!! π go forth, handle your terminal flow control, and remember: if it fails, at least it'll tell you why before it dips. no cap. slay β¨π π¦
β signed off from the explain_tcflow_or_die(3) corner of the Library Functions Manual, where it's always libexplain version 1.4, Copyright (C) 2009 Peter Miller, and always iconic π«Ά
π¦ 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