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_from_text_or_die β€” Library Functions Manual, section 3 πŸŽ€

okay bestie, sit down, hydrate, because we're about to talk about the absolute icon of the ACL-creation world: explain_acl_from_text_or_die and its chill twin, explain_acl_from_text_on_error. same header file, same vibe, two VERY different attitudes toward failure. iykyk πŸ’…


✨ NAME ✨

explain_acl_from_text_or_die β€” create an ACL from text and report errors πŸ¦‹


🌸 SYNOPSIS 🌸

#include <libexplain/acl_from_text.h>
acl_t explain_acl_from_text_or_die(const char *text);
acl_t explain_acl_from_text_on_error(const char *text);

πŸ’œ DESCRIPTION πŸ’œ

so. the explain_acl_from_text_or_die function exists to call the acl_from_text(3) system call for you, but with drama. and by drama i mean: if it fails, an explanation gets printed to stderr, obtained from the explain_acl_from_text(3) function, and then the process literally terminates by calling exit(EXIT_FAILURE). no coming back from that. it's giving main character exit. πŸ’€

the explain_acl_from_text_on_error function also calls the acl_from_text(3) system call. on failure, an explanation will be printed to stderr, obtained from the explain_acl_from_text(3) function β€” but then it still returns to the caller. it reports the tea and then hands the problem right back to you. so mature of it. 🫢

the argument πŸ“

  • text β€” the text, exactly as to be passed to the acl_from_text(3) system call. exactly, bestie. don't be creative with it.

⭐ RETURN VALUE ⭐

explain_acl_from_text_or_die only returns on success. want more info on that? see acl_from_text(3). on failure it prints an explanation and exits β€” it does not return. like, at all. not a single return value. it's gone. πŸ’€

explain_acl_from_text_on_error always returns the value return by the wrapped acl_from_text(3) system call. every single time. no notes.


🌈 EXAMPLE 🌈

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

acl_t result = explain_acl_from_text_or_die(text);

literally that simple. iconic. ✨


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page, bestie, you ate πŸ’…

this masterpiece of a manual ships with libexplain version 1.4, and the copyright belongs to Copyright (C) 2013 Peter Miller. so yeah β€” go make some ACLs, and remember: one of these functions will hold your hand and one will walk out the door. choose wisely πŸ¦‹βœ¨

πŸ“¦ where this page comes from