2 .\" Extended attributes system calls manual pages
4 .\" Copyright (C) Andreas Gruenbacher, February 2001
5 .\" Copyright (C) Silicon Graphics Inc, September 2001
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 .\" GNU General Public License for more details.
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual; if not, write to the Free
24 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
27 .TH LISTXATTR 2 2001-12-01 "Linux" "Linux Programmer's Manual"
29 listxattr, llistxattr, flistxattr \- list extended attribute names
33 .B #include <sys/types.h>
34 .B #include <attr/xattr.h>
36 .BI "ssize_t listxattr(const char\ *" path ", char\ *" list \
38 .BI "ssize_t llistxattr(const char\ *" path ", char\ *" list \
40 .BI "ssize_t flistxattr(int " fd ", char\ *" list ", size_t " size );
44 Extended attributes are name:value
45 pairs associated with inodes (files, directories, symbolic links, etc.).
46 They are extensions to the normal attributes which are associated
47 with all inodes in the system (i.e., the
50 A complete overview of extended attributes concepts can be found in
56 of extended attribute names associated with the given
59 The list is the set of (null-terminated) names, one after the other.
60 Names of extended attributes to which the calling process does not
61 have access may be omitted from the list.
62 The length of the attribute name
69 except in the case of a symbolic link, where the list of names of
70 extended attributes associated with the link itself is retrieved,
71 not the file that it refers to.
76 only the open file referred to by
80 is interrogated in place of
83 A single extended attribute
85 is a simple null-terminated string.
86 The name includes a namespace prefix; there may be several, disjoint
87 namespaces associated with an individual inode.
91 zero can be passed into these calls to return the current size of the
92 list of extended attribute names, which can be used to estimate the
93 size of a buffer which is sufficiently large to hold the list of names.
97 of names is returned as an unordered array of null-terminated character
98 strings (attribute names are separated by null bytes (\(aq\\0\(aq)), like this:
103 user.name1\\0system.name1\\0user.name2\\0
108 Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using
109 extended attributes, might return a
116 system.posix_acl_access\\0system.posix_acl_default\\0
121 On success, a positive number is returned indicating the size of the
122 extended attribute name list.
123 On failure, \-1 is returned and
125 is set appropriately.
131 buffer is too small to hold the result,
136 If extended attributes are not supported by the file system, or are disabled,
141 The errors documented for the
143 system call are also applicable here.
145 These system calls have been available on Linux since kernel 2.4;
146 glibc support is provided since version 2.3.
148 These system calls are Linux-specific.
150 .\" Andreas Gruenbacher,
151 .\" .RI < a.gruenbacher@computer.org >
152 .\" and the SGI XFS development team,
153 .\" .RI < linux-xfs@oss.sgi.com >.
154 .\" Please send any bug reports or comments to these addresses.