ACL_GET_FD(3)
π 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)NULLback, anderrnogets set appropriately. π
π ERRORS π
If any of these conditions happen, acl_get_fd() returns (acl_t)NULL and sets errno to the matching value:
[EBADF]β thefdargument 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 byfdlives 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
- alpine 3.22: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.23: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- alpine 3.24: acl-doc 2.3.2-r1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- arch rolling: acl 2.4.0-1 Β· LGPL-2.1-or-later AND GPL-2.0-or-later
- centos-stream 10: libacl-devel 2.4.0-2.el10 Β· LGPL-2.1-or-later
- centos-stream 9: libacl-devel 2.4.0-2.el9 Β· LGPLv2+
- centos-stream 9: libacl-devel 2.4.0-2.el9 Β· LGPLv2+
- debian bookworm: libacl1-dev 2.3.1-3
- debian trixie: libacl1-dev 2.3.2-2+b1
- fedora 43: libacl-devel 2.3.2-4.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.3.2-4.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.4.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 43: libacl-devel 2.4.0-1.fc43 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.3.2-6.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.3.2-6.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.4.0-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libacl-devel 2.4.0-1.fc44 Β· LGPL-2.1-or-later
- nixpkgs unstable: acl 2.4.0
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: libacl-devel 2.4.0-160000.1.1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: libacl1-dev 2.3.1-1
- ubuntu noble: libacl1-dev 2.3.2-1build1
- ubuntu noble: libacl1-dev 2.3.2-1build1.1
- ubuntu resolute: libacl1-dev 2.3.2-2
- ubuntu stonking: libacl1-dev 2.4.0-1
- (C) 2002 Andreas Gruenbacher, <andreas.gruenbacher@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms