Imported Upstream version 2.4.46
[platform/upstream/attr.git] / man / man3 / attr_remove.3
1 .\" Copyright (C) 2001, 2002, 2003, 2006 Silicon Graphics, Inc.
2 .\" All rights reserved.
3 .\"
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.
8 .\"
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.
13 .\"
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.
18 .\"
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/>.
22 .\"
23 .TH ATTR_REMOVE 3 "Extended Attributes" "Dec 2001" "XFS Compatibility API"
24 .SH NAME
25 attr_remove, attr_removef \- remove a user attribute of a filesystem object
26 .SH C SYNOPSIS
27 .PP
28 .sp
29 .nf
30 .B #include <attr/attributes.h>
31 .sp
32 .B "int attr_remove (const char *\f2path\f3, const char *\f2attrname\f3, int \f2flags\f3);"
33 .PP
34 .B "int attr_removef (int \f2fd\f3, const char *\f2attrname\f3, int \f2flags\f3);"
35 .Op
36 .SH DESCRIPTION
37 The
38 .B attr_remove
39 and
40 .B attr_removef
41 functions provide a way to remove previously created attributes
42 from filesystem objects.
43 .P
44 .I Path\^
45 points to a path name for a filesystem object, and
46 .I fd\^
47 refers to the file descriptor associated with a file.
48 If the attribute
49 .I attrname
50 exists, the attribute name and value will be removed from the
51 fileystem object.
52 The
53 .I flags
54 argument can contain the following symbols bitwise OR\'ed together:
55 .TP
56 .SM
57 \%ATTR_ROOT
58 Look for
59 .I attrname
60 in the
61 .B root
62 address space, not in the
63 .B user
64 address space.
65 (limited to use by super-user only)
66 .TP
67 .SM
68 \%ATTR_DONTFOLLOW
69 Do not follow symbolic links when resolving a
70 .I path
71 on an
72 .B attr_remove
73 function call.
74 The default is to follow symbolic links.
75 .PP
76 .B attr_remove
77 will fail if one or more of the following are true:
78 .TP 17
79 .SM
80 \%[ENOATTR]
81 The attribute name given is not associated with the indicated
82 filesystem object.
83 .TP
84 .SM
85 \%[ENOENT]
86 The named file does not exist.
87 .TP
88 .SM
89 \%[EPERM]
90 The effective user
91 .SM ID
92 does not match the owner of the file
93 and the effective user
94 .SM ID
95 is not super-user.
96 .TP
97 .SM
98 \%[ENOTDIR]
99 A component of the
100 path prefix
101 is not a directory.
102 .TP
103 .SM
104 \%[EACCES]
105 Search permission is denied on a
106 component of the
107 path prefix.
108 .TP
109 .SM
110 \%[EINVAL]
111 A bit was set in the
112 .I flag
113 argument that is not defined for this system call.
114 .TP
115 .SM
116 \%[EFAULT]
117 .I Path
118 points outside the allocated address space of the process.
119 .TP
120 .SM
121 \%[ELOOP]
122 A path name lookup involved too many symbolic links.
123 .TP
124 .SM
125 \%[ENAMETOOLONG]
126 The length of
127 .I path
128 exceeds
129 .SM
130 .RI { MAXPATHLEN },
131 or a pathname component is longer than
132 .SM
133 .RI { MAXNAMELEN }.
134 .PP
135 .B attr_removef\^
136 will fail if:
137 .TP 15
138 .SM
139 \%[ENOATTR]
140 The attribute name given is not associated with the indicated
141 filesystem object.
142 .TP
143 .SM
144 \%[EINVAL]
145 A bit was set in the
146 .I flag
147 argument that is not defined for this system call,
148 or
149 .I fd\^
150 refers to a socket, not a file.
151 .TP
152 .SM
153 \%[EFAULT]
154 .I Attrname
155 points outside the allocated address space of the process.
156 .TP
157 .SM
158 \%[EBADF]
159 .I Fd\^
160 does not refer to a valid descriptor.
161 .SH "DIAGNOSTICS"
162 On success, zero is returned.  On error, \-1 is returned, and
163 .I errno
164 is set appropriately.
165 .SH "SEE ALSO"
166 .BR attr (1),
167 .BR attr_get (3),
168 .BR attr_list (3),
169 .BR attr_multi (3),
170 and
171 .BR attr_set (3).