explain_ge...ame_or_die(3)

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

πŸ’– NAME πŸ’–

okay so bestie, this is explain_getdomainname_or_die β€” she grabs the domain name and then reports errors like the icon she is πŸŽ€


✨ SYNOPSIS ✨

#include <libexplain/getdomainname.h>
void explain_getdomainname_or_die(char *data, size_t data_size);
int explain_getdomainname_on_error(char *data, size_t data_size);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk, explain_getdomainname_or_die is the girl who calls the getdomainname(2) system call for you πŸ’… and if it fails? she prints an explanation to stderr β€” that explanation comes from the explain_getdomainname(3) function β€” and then the process literally just terminates by calling exit(EXIT_FAILURE). no coming back from that one bestie, it's giving final.

meanwhile explain_getdomainname_on_error also calls the getdomainname(2) system call, and on failure she also prints an explanation to stderr (again, obtained from the explain_getdomainname(3) function), but she still returns to the caller. so like, she's the softer one. still dramatic, but she comes back 🫢

  • data β€” the data, exactly as to be passed to the getdomainname(2) system call. exactly. don't freestyle it.
  • data_size β€” the data_size, exactly as to be passed to the getdomainname(2) system call. again: exactly, no cap.

🌸 RETURN VALUE 🌸

explain_getdomainname_or_die only returns on success β€” see getdomainname(2) for more info, she's the source of truth πŸ’– on failure she prints an explanation and exits, so like… she does not return. periodt.

explain_getdomainname_on_error always returns the value return by the wrapped getdomainname(2) system call. yes, always. she's reliable like that ✨


πŸŽ€ EXAMPLE πŸŽ€

explain_getdomainname_or_die is intended to be used in a fashion similar to the following example:

explain_getdomainname_or_die(data, data_size);

that's it, that's the whole vibe. copy it, slay it πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘


libexplain version 1.4

Copyright (C) 2009 Peter Miller


and that's the whole page bestie, go forth and call your system calls responsibly πŸ§šπŸ’œ

this has been explain_ge...ame_or_die(3) from the Library Functions Manual β€” libexplain version 1.4, brought to you by Peter Miller, copyright 2009. mwah πŸ’‹
πŸ“¦ where this page comes from