1LISTXATTR(2)                     System calls                     LISTXATTR(2)
2
3
4

NAME

6       listxattr, llistxattr, flistxattr - list extended attribute names
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <attr/xattr.h>
11
12       ssize_t listxattr (const char *path,
13                            char *list, size_t size);
14       ssize_t llistxattr (const char *path,
15                            char *list, size_t size);
16       ssize_t flistxattr (int filedes,
17                            char *list, size_t size);
18

DESCRIPTION

20       Extended attributes are name:value pairs associated with inodes (files,
21       directories,  symlinks,  etc).   They  are  extensions  to  the  normal
22       attributes which are associated with all inodes in the system (i.e. the
23       stat(2) data).  A complete overview of extended attributes concepts can
24       be found in attr(5).
25
26       listxattr  retrieves  the  list  of extended attribute names associated
27       with the given path in the filesystem.  The list is the set  of  (NULL-
28       terminated)  names,  one after the other.  Names of extended attributes
29       to which the calling process does not have access may be  omitted  from
30       the list.  The length of the attribute name list is returned.
31
32       llistxattr  is identical to listxattr, except in the case of a symbolic
33       link, where the list of names of extended  attributes  associated  with
34       the link itself is retrieved, not the file that it refers to.
35
36       flistxattr  is identical to listxattr, only the open file pointed to by
37       filedes (as returned by open(2)) is interrogated in place of path.
38
39       A single extended attribute name is a  simple  NULL-terminated  string.
40       The  name  includes a namespace prefix - there may be several, disjoint
41       namespaces associated with an individual inode.
42
43       An empty buffer of size zero can be passed into these calls  to  return
44       the  current size of the list of extended attribute names, which can be
45       used to estimate the size of a buffer which is  sufficiently  large  to
46       hold the list of names.
47

EXAMPLES

49       The  list of names is returned as an unordered array of NULL-terminated
50       character strings (attribute names are separated by  NULL  characters),
51       like this:
52              user.name1\0system.name1\0user.name2\0
53
54       Filesystems  like  ext2,  ext3 and XFS which implement POSIX ACLs using
55       extended attributes, might return a list like this:
56              system.posix_acl_access\0system.posix_acl_default\0
57

RETURN VALUE

59       On success, a positive number is returned indicating the  size  of  the
60       extended  attribute name list.  On failure, -1 is returned and errno is
61       set appropriately.
62
63       If the size of the list buffer is too small to hold the  result,  errno
64       is set to ERANGE.
65
66       If extended attributes are not supported by the filesystem, or are dis‐
67       abled, errno is set to ENOTSUP.
68
69       The errors documented for the stat(2) system call are  also  applicable
70       here.
71

AUTHORS

73       Andreas Gruenbacher, <a.gruenbacher@bestbits.at> and the SGI XFS devel‐
74       opment team, <linux-xfs@oss.sgi.com>.  Please send any bug  reports  or
75       comments to these addresses.
76

SEE ALSO

78       getfattr(1),  setfattr(1),  open(2), stat(2), getxattr(2), setxattr(2),
79       removexattr(2), and attr(5).
80
81
82
83Dec 2001                      Extended Attributes                 LISTXATTR(2)
Impressum