explain_fi...rom_fildes(3)
πΈ explain_fi...rom_fildes(3) πΈ
okay bestie, welcome to the Library Functions Manual entry for explain_fi...rom_fildes(3) β yes the name is doing a little dramatic ellipsis thing, we love a mysterious queen π
β¨ NAME β¨
explain_filename_from_fildes β bestie, this one snatches the filename straight out of a file descriptor π
β¨ SYNOPSIS β¨
#include <libexplain/filename.h>
int explain_filename_from_fildes(int fildes, char *data, size_t
data_size);
int explain_filename_from_stream(FILE *stream, char *data, size_t
data_size);
β¨ DESCRIPTION β¨
so basically π the explain_filename_from_fildes function is your girl for getting the name of the file that's associated with a file descriptor. she's giving "who even are you, fd?" energy and honestly, iconic.
and then explain_filename_from_stream does the exact same thing but for a file stream instead of a file descriptor. same vibe, different entry point, slay π
the filename gets dropped into the array that data points to. and listen β the filename is always NUL terminated, no cap. but here's the tea π: if the returned filename is longer than data_size, it will be silently truncated. like, no warning, no drama, it just gets cut. so a size of at least (PATH_MAX + 1) is suggested β take the advice bestie, don't get caught slipping.
on success? returns zero β¨. but if the file name cannot be determined, it returns -1 β and does not set errno. that's right, no errno for you. it's mysterious like that π
β¨ COPYRIGHT β¨
libexplain version 1.4 Copyright (C) 2012 Peter Miller
β¨ AUTHOR β¨
Written by Peter Miller <pmiller@opensource.org.au> π
and that's the whole page, bestie π«Ά if you made it this far you officially have main character energy. this was explain_fi...rom_fildes(3) from the Library Functions Manual, coming to you courtesy of libexplain version 1.4, copyright (C) 2012 Peter Miller. mwah π periodt.
π¦ 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) 2012 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms