ACL_INIT(3)

πŸ“¦
version 2.4.0 Β· 2 versions
  • 2.4.0 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 15.1 Β· freebsd 14.5, freebsd 15.1
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ ACL_INIT(3) ✨

okay bestie, welcome to the Library Functions Manual πŸ’– this one's called acl_init, and no cap, it's the lil' starter-pack function for your ACL era. let's get into it 🫢


🌸 NAME 🌸

acl_init β€” initialize ACL working storage ✨

πŸŽ€ LIBRARY πŸŽ€

Linux Access Control Lists library (libacl, -lacl). yes, you gotta link the lib, that's the vibe πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

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

acl_t
acl_init(int count);

πŸ’œ DESCRIPTION πŸ’œ

so the way that acl_init() works is: it allocates and initializes the working storage for an ACL of at least count ACL entries. key words: at least, iykyk.

and here's the cute part β€” the ACL it creates starts out with no ACL entries at all. empty. a blank canvas. main character energy ✨. it hands you back a pointer to that working storage, and off you go.

⚠️ heads up bestie: this function may cause memory to be allocated. so when you're done with your new ACL, the caller should free any releasable memory β€” you do that by calling acl_free(3) and passing it the (void*)acl_t that acl_init() gave you. don't ghost your malloc'd memory, it's rude 😭

πŸ”₯ RETURN VALUE πŸ”₯

  • on success β€” you get a pointer to the working storage πŸŽ‰
  • on error β€” you get a value of (acl_t)NULL, and errno is set appropriately πŸ’€

😭 ERRORS 😭

if any of these lil' situations happen, acl_init() returns (acl_t)NULL and sets errno to the matching value:

  • [EINVAL] β€” the value of count is less than zero. bestie. negative entries?? be so fr rn πŸ™ˆ
  • [ENOMEM] β€” the acl_t that's supposed to come back to you requires more memory than the hardware or the system-imposed memory management constraints will allow. the machine said "no ❀️"

πŸ‘‘ STANDARDS πŸ‘‘

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

(yes it's abandoned, we don't talk about it, it still ate tho πŸ’…)

🌈 SEE ALSO 🌈

🧚 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, periodt πŸ’– this gem comes to you from Linux ACL, dated March 23, 2002 β€” an absolute icon, still slaying after all these years ⭐ go free your ACLs, bestie, and stay hydrated πŸ“πŸ«Ά

πŸ“¦ where this page comes from