ACL_GET_FD(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_GET_FD(3) β€” bestie edition πŸ’–

okay so this is a page from the Library Functions Manual, and it's all about acl_get_fd. It lives in the Linux Access Control Lists library, which you load with -lacl. Basically: libacl, she's the moment. πŸŽ€


✨ NAME ✨

acl_get_fd β€” get an ACL by file descriptor πŸ¦‹


πŸ“š LIBRARY πŸ“š

Linux Access Control Lists library β€” that's libacl, and you link her with -lacl. no cap.


🌸 SYNOPSIS 🌸

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

acl_t
acl_get_fd(int fd);

πŸ’… DESCRIPTION πŸ’…

So acl_get_fd() goes and retrieves the access ACL that's chillin' with the file that fd is referring to. Where does it put it? Into working storage, bestie. And then acl_get_fd() hands you back a pointer to that storage. iconic behavior honestly. ✨

Now, plot twist β€” to actually read an ACL off an object, your process needs read access to that object's attributes. That's the vibe check you gotta pass. πŸ™ˆ

Also heads up: this function may cause memory to be allocated. So when you're done with the new ACL and don't need it anymore, you gotta free any releasable memory yourself by calling acl_free(3), passing in the (void*)acl_t that acl_get_fd() gave you as the argument. like, clean up after yourself, main character energy. 🧚


πŸ”₯ RETURN VALUE πŸ”₯

  • On success, this function shall return a pointer to the working storage. slay. πŸ’–
  • On error, you get a value of (acl_t)NULL back, and errno gets set appropriately. 😭

πŸ’€ ERRORS πŸ’€

If any of these conditions happen, acl_get_fd() returns (acl_t)NULL and sets errno to the matching value:

  • [EBADF] β€” the fd argument is not a valid file descriptor. girl, that's not a real fd. πŸ’€
  • [ENOMEM] β€” the ACL working storage needs more memory than the hardware or the system-imposed memory management constraints will allow. not enough room, bestie. 😭
  • [ENOTSUP] β€” the file system where the file identified by fd lives does not support ACLs, or ACLs are disabled. so... no ACLs for you. πŸ™ˆ

🌈 STANDARDS 🌈

IEEE Std 1003.1e draft 17 β€” aka "POSIX.1e" β€” and yeah, she's abandoned. rip to a legend. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

acl_free(3), acl_get_entry(3), acl_get_file(3), acl_set_fd(3), acl(5)


🫢 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>. giving credit where credit is due, periodt. ✨


and that's the whole page, bestie!! πŸ’– This one's from the Linux ACL source, dated March 23, 2002 β€” yeah she's vintage but she still ate. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from