EXPLAIN_ACL_GET_FD_OR_DIE(3)

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

πŸ’– explain_acl_get_fd_or_die(3) πŸ’–

okay bestie, welcome to the Library Functions Manual ✨ this one is explain_acl_get_fd_or_die and she is lowkey a lifesaver, no cap 🫢


🌸 NAME 🌸

explain_acl_get_fd_or_die β€” run acl_get_fd(3) and then tell you exactly what went wrong, dramatically πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libexplain/acl_get_fd.h>
acl_t explain_acl_get_fd_or_die(int fildes);
acl_t explain_acl_get_fd_on_error(int fildes);

✨ DESCRIPTION ✨

so there's two of them, right, and they're sisters πŸ‘―

The explain_acl_get_fd_or_die function is here to call the acl_get_fd(3) system call for you. And if it fails? it prints an explanation to stderr β€” that explanation comes from the explain_acl_get_fd(3) function β€” and then it ends the whole process by calling exit(EXIT_FAILURE). it does not come back. it's giving "we ride at dawn and if we lose we're done" 😭

The explain_acl_get_fd_on_error function also calls the acl_get_fd(3) system call. On failure it prints that same explanation to stderr, obtained from the explain_acl_get_fd(3) function, but this one is chill and still returns to the caller 🫢

  • fildes β€” the fildes, exactly as to be passed to the acl_get_fd(3) system call. like, don't get creative with it, bestie, pass it exactly as-is πŸ‘‘

πŸŽ€ RETURN VALUE πŸŽ€

The explain_acl_get_fd_or_die function only returns on success β€” peep acl_get_fd(3) for more info on that. On failure it prints an explanation and exits, so it does not return. at all. periodt πŸ’€

The explain_acl_get_fd_on_error function always returns the value return by the wrapped acl_get_fd(3) system call. every time, no exceptions, iconic behavior πŸ‘‘


🌈 EXAMPLE 🌈

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

explain_acl_get_fd_or_die(fildes);

that's it, that's the whole vibe ✨


πŸ’œ SEE ALSO πŸ’œ


libexplain version 1.4 Copyright (C) 2013 Peter Miller


and that's the tea πŸ“ this was explain_ac...t_fd_or_die(3) β€” libexplain version 1.4, Copyright (C) 2013 Peter Miller β€” mwah, love u, go pass a valid file descriptor πŸ’–πŸ§š

πŸ“¦ where this page comes from