EXTATTR(3)

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

πŸ’… extattr(3) β€” Library Functions Manual πŸ’…

okay bestie, welcome to the extattr(3) page β€” the Library Functions Manual one, obviously. We're gonna make extended attribute namespace conversion make sense, fr fr. πŸ’–


🌸 NAME 🌸

  • extattr_namespace_to_string, extattr_string_to_namespace β€” convert an extended attribute namespace identifier to a string and vice versa. periodt. ✨

🧚 LIBRARY 🧚

System Utilities Library (libutil, -lutil) β€” yes bestie, that's the one. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/extattr.h>
#include <libutil.h>

int
extattr_namespace_to_string(int attrnamespace, char **string);

int
extattr_string_to_namespace(const char *string, int *attrnamespace);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so extattr_namespace_to_string() takes a VFS extended attribute identifier and turns it into a human-readable string. Cute. And extattr_string_to_namespace() literally undoes that whole operation: it takes a human-readable string that represents a namespace and converts it into a namespace identifier. Iconic teamwork. πŸ’–

Now, a file system may implement arbitrary namespaces, but these functions only support two: EXTATTR_NAMESPACE_USER (β€œuser”) and EXTATTR_NAMESPACE_SYSTEM (β€œsystem”). Both are defined in extattr(9). That's the vibe check, no cap. 🌈

These functions are meant to be used in error reporting and other interactive tasks. For example, instead of printing the integer identifying an extended attribute in an error message, a program might use extattr_namespace_to_string() to obtain a human-readable representation. Likewise, instead of requiring a user to enter the integer representing a namespace, an interactive program might ask for a name and use extattr_string_to_namespace() to get the desired identifier. main character energy for error messages, honestly. πŸŽ€


😭 RETURN VALUES 😭

If any of the calls are unsuccessful, the value -1 is returned and the global variable errno is set to indicate the error. That's it β€” no cap. If it's a flop, you get -1 and errno spills the tea. πŸ’€


πŸ’… ERRORS πŸ’…

  • [EINVAL] β€” The requested namespace could not be identified.

πŸ”₯ SEE ALSO πŸ”₯

go check these out bestie:


πŸ‘‘ HISTORY πŸ‘‘

Extended attribute support was developed as part of the TrustedBSD Project, and introduced in FreeBSD 5.0. It was developed to support security extensions requiring additional labels to be associated with each file or directory. history lesson slay. 🫢


mwah πŸ’‹ β€” from the Debian crew, dated June 24, 2001, and it's the EXTATTR(3) page. bye bestie, go convert some namespaces πŸŒˆπŸ’…

πŸ“¦ where this page comes from