ACL_ENTRIES(3)

πŸ’– ACL_ENTRIES(3) πŸ’–

okay bestie, pull up a chair, we're doing a Library Functions Manual moment and honestly? this one is a little icon. it's acl_entries from the Linux Access Control Lists library (that's libacl, link it with -lacl) πŸŽ€


🌸 NAME 🌸

acl_entries β€” return the number of entries in an ACL ✨

no cap, that's literally the whole job. it counts the entries in an ACL. she's simple, she's effective, she ate πŸ’…


πŸ¦‹ LIBRARY πŸ¦‹

Linux Access Control Lists library β€” libacl, -lacl. that's your girl. link against her or she will not show up, fr fr 🫢


✨ SYNOPSIS ✨

#include <sys/types.h>
#include <acl/libacl.h>

int
acl_entries(acl_t acl);

okay so you gotta pull in <sys/types.h> first, then <acl/libacl.h> β€” order matters, bestie, don't be chaotic about it πŸ™ˆ then you call her with one acl_t and she hands you back an int. that's the whole vibe.


πŸ’œ DESCRIPTION πŸ’œ

so the acl_entries() function returns the number of ACL entries that are contained in the ACL referred to by the argument acl.

that's it. that's the function. she counts. she reports. she slays. no side quests, no plot twists, no main character drama β€” just a number πŸ”₯


πŸ‘‘ RETURN VALUE πŸ‘‘

  • success β†’ acl_entries() returns the number of entries in acl ⭐
  • not success β†’ the value -1 is returned, and the global variable errno is set to indicate the error 😭

so like, always check for -1 before you get too excited, okay? she will tell you when something's wrong, but only through errno. that's her love language.


🌈 ERRORS 🌈

if any of these conditions happen, acl_entries() returns -1 and sets errno to the matching value:

  • [EINVAL] β€” the argument acl is not a valid pointer to an ACL πŸ’€
lowkey important: hand her a garbage pointer and she's not gonna be nice about it. EINVAL, -1, done. no cap.

🧚 STANDARDS 🧚

this one is a non-portable, Linux specific extension to the ACL manipulation functions defined in IEEE Std 1003.1e draft 17 β€” aka "POSIX.1e" β€” which, and I cannot stress this enough, was abandoned 😭

so like... yes she's serving, yes she's iconic, but she does not travel. don't expect her to show up on other systems, because she won't. portability girlies, this is your warning 🫢


πŸ“ SEE ALSO πŸ“


🌸 AUTHOR 🌸

Written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>. thank you for your service king πŸ‘‘


and that's the whole page, bestie!! this was the Linux ACL manual, dated March 23, 2002, filed under ACL_ENTRIES(3) β€” go forth and count your entries, you've got this πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from