explain_pipe2_or_die(3)
π explain_pipe2_or_die π
okay bestie, you found the <libexplain/pipe2.h> page, aka the Library Functions Manual entry for explain_pipe2_or_die β and yes she's a whole vibe. let's get into it π«Ά
β¨ NAME β¨
explain_pipe2_or_die β create pipe and report errors
πΈ SYNOPSIS πΈ
#include <libexplain/pipe2.h>
void explain_pipe2_or_die(int *fildes, int flags);
int explain_pipe2_on_error(int *fildes, int flags);
π DESCRIPTION π
so like, there are two functions here and they're sisters, not twins, okay?
explain_pipe2_or_dieβ she's the dramatic one. she calls thepipe2(2)system call, and if things go sideways, an explanation gets printed tostderr(obtained from theexplain_pipe2(3)function), and then the process terminates by callingexit(EXIT_FAILURE). no survivors. periodt. πexplain_pipe2_on_errorβ she's the chill one. she also calls thepipe2(2)system call, and on failure an explanation is still printed tostderr, obtained from theexplain_pipe2(3)function β but she still returns to the caller. she just tells you what happened and keeps it moving. π¦
now the arguments, because details matter:
fildesβ thefildes, exactly as to be passed to thepipe2(2)system call. no notes, no edits, pass it through as-is. β¨flagsβ theflags, exactly as to be passed to thepipe2(2)system call. same energy. π
β RETURN VALUE β
explain_pipe2_or_die only returns on success β see pipe2(2) for more information. on failure she prints an explanation and exits, so like... she does not return. at all. she's gone. π
explain_pipe2_on_error always returns the value returned by the wrapped pipe2(2) system call. every single time. reliable queen. π
π EXAMPLE π
the explain_pipe2_or_die function is intended to be used in a fashion similar to the following example:
explain_pipe2_or_die(fildes, flags);
that's it. that's the whole thing. iconic, honestly. π
π§ SEE ALSO π§
pipe2(2)β create pipeexplain_pipe2(3)β explainpipe2(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2013 Peter Miller
and that's the page bestie!! πΈ libexplain version 1.4, copyright 2013 Peter Miller β go forth and pipe 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) 2013 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms