ACL_ADD_FLAG_NP(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… acl_add_flag_np(3) β€” like, the whole manual page, bestie

okay so real talk: this is a page from the Library Functions Manual, and it lives in the Standard C Library (libc, -lc) πŸ’–. It's about adding flags to a flagset. Yes, flags for a flagset. We love a bit of recursion in the naming, it's giving inception πŸŒ€.


✨ NAME ✨

acl_add_flag_np β€” add flags to a flagset πŸŽ€


🌸 LIBRARY 🌸

Standard C Library (libc, -lc) 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

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

int
acl_add_flag_np(acl_flagset_t flagset_d, acl_flag_t flag);

πŸ”₯ DESCRIPTION πŸ”₯

So the acl_add_flag_np() function is a non-portable call β€” meaning it's not gonna work everywhere, it's a little special-diva function, okurrr β€” and what it does is it adds the NFSv4 ACL flags contained in flags to the flagset flagset_d. Slay. That's the whole job. πŸ‘‘

πŸ’‘ Note: it is not considered an error to attempt to add flags that already exist in the flagset. So if you're out here double-adding, the function is not gonna be mad at you. It's chill like that. No dupes drama. πŸ™ˆ

The valid values are, and I need you to memorize these because they're literally the whole personality of this function:

  • ACL_ENTRY_FILE_INHERIT β€” will be inherited by files πŸ“„
  • ACL_ENTRY_DIRECTORY_INHERIT β€” will be inherited by directories πŸ“
  • ACL_ENTRY_NO_PROPAGATE_INHERIT β€” will not propagate 🚫
  • ACL_ENTRY_INHERIT_ONLY β€” inherit-only ✨
  • ACL_ENTRY_INHERITED β€” inherited from parent πŸ‘‘

πŸ’€ RETURN VALUES πŸ’€

  • returns the value 0 if successful β€” iconic, we love a zero πŸŽ‰
  • otherwise the value -1 is returned, and the global variable errno is set to indicate the error 😭 (yes, the global. the classic. the errno we all know and have beef with.)

πŸ™ˆ ERRORS πŸ™ˆ

The acl_add_flag_np() function fails if:

  • [EINVAL] β€” argument flagset_d is not a valid descriptor for a flagset within an ACL entry. Also, argument flag does not contain a valid acl_flag_t value. Basically: wrong descriptor, or wrong flag value, and it's a no from her. β›”

🌈 SEE ALSO 🌈

go read these, they're the friend group iykyk 🫢


πŸ‘‘ STANDARDS πŸ‘‘

POSIX.1e is described in IEEE POSIX.1e draft 17. that's the lore. that's the source material πŸ“œ


🧚 HISTORY 🧚

POSIX.1e support was introduced in FreeBSD 4.0. The acl_add_flag_np() function was added in FreeBSD 8.0. glow-up timeline fr fr ⭐


πŸ’œ AUTHORS πŸ’œ

The acl_add_flag_np() function was written by Edward Tomasz Napierala <trasz@FreeBSD.org>. we stan a legend πŸŽ€


and that's the page!! πŸ’… this edition dropped from Debian, dated September 4, 2015 β€” so it's vintage, it's classic, it's lowkey a collector's item now 🌸 bye bestie, go add some flags πŸ”₯

πŸ“¦ where this page comes from