explain_ac...ext_or_die(3)

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

πŸ’– explain_acl_to_text_or_die(3) β€” bestie edition πŸ’–

okay so we're in the <libexplain> library functions manual and today's main character is explain_acl_to_text_or_die(3): she converts an ACL to text AND reports errors like the icon she is. no cap. ✨


🌸 NAME 🌸

explain_acl_to_text_or_die β€” convert an ACL to text and report errors πŸ¦‹


✨ SYNOPSIS ✨

#include <libexplain/acl_to_text.h>
char *explain_acl_to_text_or_die(acl_t acl, ssize_t *len_p);
char *explain_acl_to_text_on_error(acl_t acl, ssize_t *len_p);

two sisters, same signature, very different energy. iykyk πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

explain_acl_to_text_or_die</purl> is the dramatic one. she calls the acl_to_text(3) system call, and if that goes sideways she prints an explanation to stderr β€” grabbed from the explain_acl_to_text(3) function β€” and then the process terminates by calling exit(EXIT_FAILURE). it's giving no survivors. periodt. πŸ’€

explain_acl_to_text_on_error is the chill one. she also calls acl_to_text(3), and on failure she also prints an explanation to stderr from explain_acl_to_text(3)… but she still returns to the caller. she simply refuses to make it a whole thing. 🫢

and here's the tea on the parameters, exactly as they get passed along:

  • acl β€” the acl, exactly as to be passed to the acl_to_text(3) system call. no edits, no vibes-based tweaking, we hand her over as-is. πŸ’–
  • len_p β€” the len_p, exactly as to be passed to the acl_to_text(3) system call. same deal, untouched. ✨

πŸŽ€ RETURN VALUE πŸŽ€

explain_acl_to_text_or_die only returns on success β€” peep acl_to_text(3) for more info. on failure she prints an explanation and exits, so like… she does not return. at all. ever. 😭

explain_acl_to_text_on_error always returns the value returned by the wrapped acl_to_text(3) system call. always. she's reliable like that. πŸ‘‘


🌈 EXAMPLE 🌈

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

char *result = explain_acl_to_text_or_die(acl, len_p);

that's it, that's the whole vibe. one line, maximum slay. πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹


libexplain version 1.4 Copyright (C) 2013 Peter Miller


and that's the page bestie πŸŽ€ this was explain_ac...ext_or_die(3) from the library functions manual, brought to you by libexplain version 1.4 and the one and only Copyright (C) 2013 Peter Miller β€” mwah, stan forever, go read acl_to_text(3) next, ily πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from