ACL_SIZE(3)

✨ ACL_SIZE(3) ✨

okay so bestie, we're in the Library Functions Manual and this is the glow-up guide to acl_size πŸ’…


🌸 NAME 🌸

acl_size β€” get the size of the external representation of an ACL

no cap, that's literally the whole vibe: it tells you how big a thing needs to be 🫢


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library (libacl, -lacl).

like, that's the library you gotta link against, periodt.


πŸŽ€ SYNOPSIS πŸŽ€

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

ssize_t
acl_size(acl_t acl);

πŸ’– DESCRIPTION πŸ’–

The acl_size() function returns the size, in bytes, of the buffer required to hold the exportable, contiguous, persistent form of the ACL pointed to by the argument acl, when it's converted by acl_copy_ext(). so basically it's giving "how much room do I need for the snack" energy πŸ“

Any existing ACL entry descriptors that refer to entries in acl continue to refer to the same entries. Any existing ACL pointers that refer to the ACL referred to by acl continue to refer to the ACL. The order of ACL entries within acl remains unchanged.

and like, none of that changes anything, bestie β€” nothing moves, nothing gets shuffled, no chaos, no drama πŸ™ˆ the pointers stay pointed, the entries stay entries, the order stays the order. iconic behaviour honestly πŸ‘‘

🌈 RETURN VALUE 🌈

On success, the acl_size() function returns the size in bytes of the contiguous, persistent form of the ACL. On error, a value of (ssize_t)-1 is returned and errno is set appropriately.

so like: number = good, (ssize_t)-1 = we have a situation 😭


πŸ’€ ERRORS πŸ’€

If any of the following conditions occur, the acl_size() function returns a value of (ssize_t)-1 and sets errno to the corresponding value:

  • [EINVAL] β€” The argument acl is not a valid pointer to an ACL.

that's it, that's the whole list, one single red flag and it's this one 🚩


πŸ‘‘ STANDARDS πŸ‘‘

IEEE Std 1003.1e draft 17 (β€œPOSIX.1e”, abandoned)

yeah bestie, abandoned 😭 the draft said goodbye but the function said "not me, I'm still here" 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

iykyk, go read those next πŸ’œ


✨ AUTHOR ✨

Derived from the FreeBSD manual pages written by Robert N M Watson <rwatson@FreeBSD.org>, and adapted for Linux by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>.


and that's the whole page, bestie!! 🌸 this was the Linux ACL version, dated March 23, 2002 β€” shoutout to the legends who wrote and adapted it, we owe them everything πŸ’–βœ¨πŸŽ€ mwah, go check your ACL sizes responsibly πŸ«ΆπŸ’…

πŸ“¦ where this page comes from