1 .\" Copyright (C) 2001, 2002, 2006 Silicon Graphics, Inc.
2 .\" All rights reserved.
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual. If not, see
21 .\" <http://www.gnu.org/licenses/>.
23 .TH ATTR_LIST 3 "Extended Attributes" "Dec 2005" "XFS Compatibility API"
25 attr_list, attr_listf \- list the names of the user attributes of a filesystem object
30 .B #include <sys/attributes.h>
32 .B "int attr_list (const char \(**path, char \(**buffer, "
33 .B " const int buffersize, int flags,"
34 .B " attrlist_cursor_t \(**cursor);"
36 .B "int attr_listf (int fd, char \(**buffer, "
37 .B " const int buffersize, int flags,"
38 .B " attrlist_cursor_t \(**cursor);"
45 functions provide a way to list the existing attributes of a
49 points to a path name for a filesystem object, and
51 refers to the file descriptor associated with a file.
54 will be filled with a structure describing at least a portion of the
55 attributes associated with the given filesystem object.
57 will be overwritten with an \f4attrlist_t\fP structure
58 containing a list of the attributes associated with
59 that filesystem object, up to a maximum of
64 must be sufficiently large to hold the appropriate data structures
65 plus at least one maximally sized attribute name,
66 but cannot be more than ATTR_MAX_VALUELEN (currently 64KB) bytes in length.
69 The contents of an \f4attrlist_t\fP structure include the following members:
75 __int32_t al_count; /\(** number of entries in attrlist \(**/
76 __int32_t al_more; /\(** T/F: more attrs (do syscall again) \(**/
77 __int32_t al_offset[1]; /\(** byte offsets of attrs [var-sized] \(**/
84 field shows the number of attributes represented in this buffer,
85 which is also the number of elements in the
90 field will be non-zero if another
92 call would result in more attributes.
95 array contains the byte offset within the
97 of the structure describing each of the attributes,
98 an \f4attrlist_ent_t\fP structure.
99 The \f4ATTR_ENTRY(buffer, index)\fP macro will help with decoding the list.
100 It takes a pointer to the
106 array and returns a pointer to the corresponding
107 \f4attrlist_ent_t\fP structure.
109 The contents of an \f4attrlist_ent_t\fP structure
110 include the following members:
116 u_int32_t a_valuelen; /\(** number bytes in value of attr \(**/
117 char a_name[]; /\(** attr name (NULL terminated) \(**/
125 field shows the size in bytes of the value
126 associated with the attribute whose name is stored in the
129 The name is a NULL terminated string.
131 Note that the value of the attribute cannot be obtained through
134 call should be used to get the value.
137 interface tells the calling process how large of a buffer
138 it must have in order to get the attribute\'s value.
142 argument can contain the following symbols bitwise OR\'ed together:
146 List the attributes that are in the
148 address space, not in the
151 (limited to use by super-user only)
155 Do not follow symbolic links when resolving a
160 The default is to follow symbolic links.
164 argument is a pointer to an opaque data structure that the kernel uses
165 to track the calling process\'s position in the attribute list.
166 The only valid operations on a
168 are to pass it into an
170 function call or to zero it out.
171 It should be zero\'ed out before the first
174 Note that multi-threaded applications may keep more than one
176 in order to serve multiple contexts, ie: the
178 call is "thread-safe".
181 will fail if one or more of the following are true:
185 The named file does not exist.
191 does not match the owner of the file
192 and the effective user
204 Search permission is denied on a
212 argument that is not defined for this system call,
213 or the buffer was too small or too large.
221 points outside the allocated address space of the process, or
225 are not 32bit aligned.
229 A path name lookup involved too many symbolic links.
238 or a pathname component is longer than
245 does not exist for this file.
254 argument that is not defined for this system call, or
256 refers to a socket, not a file,
257 or the buffer was too small or too large.
265 points outside the allocated address space of the process, or
269 are not 32bit aligned.
274 does not refer to a valid descriptor.
276 Upon successful completion, a value of 0 is returned.
277 Otherwise, a value of \-1 is returned and
279 is set to indicate the error.