ACL_GET_FLAG_NP(3)

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

✨ ACL_GET_FLAG_NP(3) ✨

okay so bestie, we're in the Library Functions Manual today, section 3, and the star of the show is acl_get_flag_np β€” say it with me: "check if a flag is set in a flagset." that's the whole vibe. πŸ’…


πŸŽ€ NAME πŸŽ€

acl_get_flag_np β€” check if a flag is set in a flagset

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc) β€” yeah she lives in libc, iconic behavior honestly 🫢

🌸 SYNOPSIS 🌸

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

int
acl_get_flag_np(acl_flagset_t flagset_d, acl_flag_t flag);

πŸ’– DESCRIPTION πŸ’–

so the acl_get_flag_np() function is a non-portable function (iykyk, that _np suffix is literally telling you she's not playing by POSIX rules) and what she does is check if a NFSv4 ACL flag is set in a flagset. that's it. that's the function. lowkey obsessed with how simple that is ✨

πŸ‘‘ RETURN VALUES πŸ‘‘

here's the vibe check:

  • if the flag in flag is set in the flagset flagset_d β†’ you get a 1 πŸŽ‰
  • otherwise β†’ you get a 0 πŸ™ˆ

one or zero, no in-between, no "maybe", periodt.

πŸ’€ ERRORS πŸ’€

okay so if any of these conditions happen, the acl_get_flag_np() function will return a value of -1 and set the global variable errno to the corresponding value. not the slay outcome but we move:

  • [EINVAL] β€” argument flag does not contain a valid ACL flag or argument flagset_d is not a valid ACL flagset. basically: one of your inputs is not giving what it needs to give 😭

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, go say hi:

🌈 STANDARDS 🌈

POSIX.1e is described in IEEE POSIX.1e draft 17. yes, a draft, that's the lore fr fr πŸ“œ

⭐ HISTORY ⭐

POSIX.1e support was introduced in FreeBSD 4.0. the acl_get_flag_np() function was added in FreeBSD 8.0. glow-up timeline, honestly πŸ’œ

🧚 AUTHORS 🧚

the acl_get_flag_np() function was written by Edward Tomasz Napierala <trasz@FreeBSD.org> β€” thank you for your service king 🫑


bestie reminder: that -1 return means always check errno, and that _np means non-portable so don't take her on a world tour without checking first, k? πŸ“

mwah, that's the page β€” brought to you by the Debian crew, dated October 30, 2014, and yes she's still serving looks all these years later πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from