explain_fcntl_or_die(3)
β¨ explain_fcntl_or_die(3) β¨
okay bestie, welcome to the Library Functions Manual page for explain_fcntl_or_die π
this one lives in the 3 section, so it's a library function, not a command you just type β iykyk π«Ά
πΈ NAME πΈ
explain_fcntl_or_die β manipulate a file descriptor and report errors π
π¦ SYNOPSIS π¦
#include <libexplain/fcntl.h>
int explain_fcntl_or_die(int fildes, int command, long arg);
β¨ DESCRIPTION β¨
so the tea is: the explain_fcntl_or_die function is literally just here to call the fcntl(2) system call for you. that's it, that's the job π
but here's the main character moment β if it fails? it prints an explanation to stderr, which it gets from explain_fcntl(3), and then the process terminates by calling exit(EXIT_FAILURE). so like, no coming back from that one π it does not return on failure, periodt.
this function is intended to be used in a fashion similar to the following example:
int result = explain_fcntl_or_die(fildes, command, arg);
fildesβ thefildes, exactly as to be passed to thefcntl(2)system call. no edits, no vibes, just hand it over as-is πcommandβ thecommand, exactly as to be passed to thefcntl(2)system call. same energy, keep it exact βargβ thearg, exactly as to be passed to thefcntl(2)system call. yes bestie, exactly π- Returns: this function only returns on success, and when it does, it returns whatever was returned by the
fcntl(2)call. heads up though β depending on thecommand, that return value may have no use π
on failure it prints an explanation and exits. it does not return. it's giving ghosted π«₯
π SEE ALSO π
fcntl(2)β manipulate a file descriptor πexplain_fcntl(3)β explainfcntl(2)errors π₯exit(2)β terminate the calling process π
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2008 Peter Miller
okay that's the whole page bestie, slay π this was explain_fcntl_or_die(3) from libexplain version 1.4, copyright (C) 2008 Peter Miller β go forth and manipulate those file descriptors 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) 2008, 2009, 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms