explain_link_or_die(3)

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

okay bestie, welcome to the Library Functions Manual β€” this one's short, sweet, and honestly kind of iconic ✨


🌸 NAME 🌸

explain_link_or_die β€” make a new name for a file and report errors 🫢


✨ SYNOPSIS ✨

#include <libexplain/link.h>
void explain_link_or_die(const char *oldpath, const char *newpath);

πŸ’… DESCRIPTION πŸ’…

so like. the explain_link_or_die function is the girl who calls the link(2) system call for you. and if things go ✨wrong✨? she prints an explanation straight to stderr β€” that explanation comes from explain_link(3) β€” and then she ends the whole process by calling exit(EXIT_FAILURE). no cap, that's the whole vibe. πŸ’€

this function is meant to be used in a fashion similar to the following example:

explain_link_or_die(oldpath, newpath);
  • oldpath β€” the oldpath, exactly as to be passed to the link(2) system call. like, don't get creative with it, hand it over as-is 🌸
  • newpath β€” the newpath, exactly as to be passed to the link(2) system call. same energy, exactly as-is πŸŽ€

Returns:

this function only returns on success. on failure, she prints an explanation and exits. periodt. πŸ‘‘

ngl bestie, "only returns on success" is doing a LOT of heavy lifting in that sentence β€” if it fails, you literally do not come back. plan accordingly 😭

πŸ¦‹ SEE ALSO πŸ¦‹


  • libexplain version 1.4 ⭐
  • Copyright (C) 2008 Peter Miller πŸ’œ

okay that's the whole page, you ate that πŸ“ and for the cute sign-off: this lil masterpiece lives under the header explain_link_or_die(3), comes to you courtesy of libexplain version 1.4, and it's copyright 2008 Peter Miller β€” mwah, go link some files bestie πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from