EXTATTR(3) | NetBSD Library Functions Manual | EXTATTR(3) |
int
extattr_namespace_to_string(int attrnamespace, char **string);
int
extattr_string_to_namespace(const char *string, int *attrnamespace);
int
extattr_copy_file(const char *from, const char *to, int namespace);
int
extattr_copy_fd(int from_fd, int to_fd, int namespace);
int
extattr_copy_link(const char *from, const char *to, int namespace);
int
cpxattr(const char *from, const char *to);
int
fcpxattr(int from_fd, int to_fd);
int
lcpxattr(const char *from, const char *to);
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.
extattr_copy_file() copies extended attributes of namespace namespace from a file to another one. extattr_copy_fd() does the same using open file descriptors, and extattr_copy_link() does the same as extattr_copy_file() but operates on symbolic links themselves instead of their targets.
cpxattr(), fcpxattr(), and lcpxattr() respectively work the same was as extattr_copy_file(), extattr_copy_fd(), and extattr_copy_link(), but will copy extended attributes from all namespaces accessible to the user, silently skiping unaccessible namespaces.
Please note that none of the extended attribute copying functions are atomic.
Extended attribute copying functions may also raise errors produced by extattr_list_file() and extattr_get_file().
January 2, 2004 | NetBSD 5.99 |