Info

#define XATTR_OS2_PREFIX "os2."

#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) #define XATTR_SECURITY_PREFIX "security."

#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1) #define XATTR_SYSTEM_PREFIX "system."

#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1) #define XATTR_TRUSTED_PREFIX "trusted."

#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1) #define XATTR_USER_PREFIX "user."

#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) The kernel provides several system calls to read and manipulate extended attributes:

□ setxattr is used to set or replace the value of an extended attribute or to create a new one.

□ getxattr retrieves the value of an extended attribute.

□ removexattr removes an extended attribute.

□ listxattr provides a list of all extended attributes associated with a given filesystem object.

Note that all calls are also available with the prefix l; this variant does not follow symbolic links by resolving them but operates on the extended attributes of the link itself. Prefixing the calls with f does not work on a filename given by a string, but uses a file descriptor as the argument.

As usual, the manual pages provide more information about how these system calls must be used and provide the exact calling convention.

Continue reading here: Interface to the Virtual Filesystem

Was this article helpful?

0 0