1 .\" Copyright (C) 2001, 2002, 2003, 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_SET 3 "Extended Attributes" "Dec 2001" "XFS Compatibility API"
25 attr_set, attr_setf \- set the value of a user attribute of a filesystem object
30 .B #include <attr/attributes.h>
32 .B "int attr_set (const char *\f2path\f3, const char *\f2attrname\f3, "
33 .B " const char *\f2attrvalue\f3, const int \f2valuelength\f3,"
34 .B " int \f2flags\f3);"
36 .B "int attr_setf (int \f2fd\f3, const char *\f2attrname\f3, "
37 .B " const char *\f2attrvalue\f3, const int \f2valuelength\f3,"
38 .B " int \f2flags\f3);"
45 functions provide a way to create attributes and set/change their values.
48 points to a path name for a filesystem object, and
50 refers to the file descriptor associated with a file.
53 does not exist, an attribute with the given name and value will be created
54 and associated with that indicated filesystem object.
55 If an attribute with that name already exists on that filesystem object,
56 the existing value is replaced with the new value given in this call.
57 The new attribute value is copied from the
64 argument can contain the following symbols bitwise OR'ed together:
72 address space, not in the
75 (limited to use by super-user only)
79 Do not follow symbolic links when resolving a
84 The default is to follow symbolic links.
88 Return an error (EEXIST) if an attribute of the given name
89 already exists on the indicated filesystem object,
90 otherwise create an attribute with the given name and value.
91 This flag is used to implement a pure create operation,
94 will create the attribute if it does not already exist.
95 An error (EINVAL) will be returned if both ATTR_CREATE and ATTR_REPLACE
96 are set in the same call.
100 Return an error (ENOATTR) if an attribute of the given name
101 does not already exist on the indicated filesystem object,
102 otherwise replace the existing attribute\'s value with the given value.
103 This flag is used to implement a pure replacement operation,
106 will create the attribute if it does not already exist.
107 An error (EINVAL) will be returned if both ATTR_CREATE and ATTR_REPLACE
108 are set in the same call.
111 will fail if one or more of the following are true:
115 The attribute name given is not associated with the indicated
116 filesystem object and the ATTR_REPLACE flag bit was set.
120 The value of the given attribute is too large, it exceeds the
121 maximum allowable size of an attribute value.
125 The attribute name given is already associated with the indicated
126 filesystem object and the ATTR_CREATE flag bit was set.
130 The named file does not exist.
136 does not match the owner of the file
137 and the effective user
149 Search permission is denied on a
157 argument that is not defined for this system call,
158 or both the ATTR_CREATE and ATTR_REPLACE flags bits were set.
166 points outside the allocated address space of the process.
170 A path name lookup involved too many symbolic links.
179 or a pathname component is longer than
188 The attribute name given is not associated with the indicated
189 filesystem object and the ATTR_REPLACE flag bit was set.
193 The value of the given attribute is too large, it exceeds the
194 maximum allowable size of an attribute value.
198 The attribute name given is already associated with the indicated
199 filesystem object and the ATTR_CREATE flag bit was set.
205 argument that is not defined for this system call,
206 or both the ATTR_CREATE and ATTR_REPLACE flags bits were set, or
208 refers to a socket, not a file.
215 points outside the allocated address space of the process.
220 does not refer to a valid descriptor.
222 On success, zero is returned. On error, \-1 is returned, and
224 is set appropriately.