]> git.saurik.com Git - apple/xnu.git/blame - bsd/man/man2/removexattr.2
xnu-6153.11.26.tar.gz
[apple/xnu.git] / bsd / man / man2 / removexattr.2
CommitLineData
91447636
A
1.\"
2.\" Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3.\"
6601e61a 4.\" @APPLE_LICENSE_HEADER_START@
91447636 5.\"
8f6c56a5
A
6.\" This file contains Original Code and/or Modifications of Original Code
7.\" as defined in and that are subject to the Apple Public Source License
8.\" Version 2.0 (the 'License'). You may not use this file except in
9.\" compliance with the License. Please obtain a copy of the License at
10.\" http://www.opensource.apple.com/apsl/ and read it before using this
91447636
A
11.\" file.
12.\"
8f6c56a5
A
13.\" The Original Code and all software distributed under the License are
14.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17.\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18.\" Please see the License for the specific language governing rights and
91447636
A
19.\" limitations under the License.
20.\"
6601e61a 21.\" @APPLE_LICENSE_HEADER_END@
91447636
A
22.\"
23.Dd Oct 19, 2004
24.Dt REMOVEXATTR 2
25.Os "Mac OS X"
26.Sh NAME
27.Nm removexattr,
28.Nm fremovexattr
29.Nd remove an extended attribute value
30.Sh SYNOPSIS
31.Fd #include <sys/xattr.h>
32.Ft int
33.Fn removexattr "const char *path" "const char *name" "int options"
34.Ft int
35.Fn fremovexattr "int fd" "const char *name" "int options"
36.Sh DESCRIPTION
37Extended attributes extend the basic attributes associated with files and
38directories in the file system. They are stored as name:data pairs
39associated with file system objects (files, directories, symlinks, etc).
40.Pp
39037602 41.Fn removexattr
91447636
A
42deletes the extended attribute
43.Fa name
44associated with
45.Fa path .
46.Pp
47An extended attribute's
48.Fa name
49is a simple NULL-terminated UTF-8 string.
50.Fa Options
51is a bit mask specifying various options:
52.Pp
53.Bl -tag -width XATTR_NOFOLLOW
54.It Dv XATTR_NOFOLLOW
55do not follow symbolic links. Normally,
56.Fn removexattr
57acts on the target of
58.Fa path
59if it is a symbolic link. With this option,
60.Fn removexattr
61will act on the link itself.
b0d623f7
A
62.It Dv XATTR_SHOWCOMPRESSION
63.Fn removexattr
64and
65.Fn fremovexattr
66will remove HFS Plus Compression extended attribute
67.Fa name
68(if present) for the file referred to by
69.Fa path
70or
71.Fa fd .
91447636
A
72.El
73.Pp
74.Fn fremovexattr
75is identical to
76.Fn removexattr ,
77except that it removes an extended attribute from an open file referenced
78by file descriptor
79.Fa fd .
80.Sh RETURN VALUES
81On success, 0 is returned. On failure, -1 is returned and the global
82variable
83.Va errno
84is set as follows.
85.Sh ERRORS
86.Bl -tag -width Er
87.It Bq Er ENOATTR
88The specified extended attribute does not exist.
89.It Bq Er ENOTSUP
90The file system does not support extended attributes or has the feature
91disabled.
92.It Bq Er EROFS
93The file system is mounted read-only.
94.It Bq Er EPERM
95This type of object does not support extended attributes.
96.It Bq Er EINVAL
97.Fa name
98or
99.Fa options
100is invalid.
101.Fa name
102must be valid UTF-8
103.Fa options
104must make sense.
105.It Bq Er ENOTDIR
106A component of the
107.Fa path 's
108prefix is not a directory.
109.It Bq Er ENAMETOOLONG
110.Fa Name
111exceeded
112.Dv XATTR_MAXNAMELEN
113UTF-8 bytes, or a component of
114.Fa path
115exceeded
116.Dv NAME_MAX
117characters, or the entire
118.Fa path
119exceeded
120.Dv PATH_MAX
121characters.
122.It Bq Er EACCES
123Search permission is denied for a component
124.Fa path
125or permission to remove the attribute is denied.
126.It Bq Er ELOOP
127Too many symbolic links were encountered in
128.Fa path .
129.It Bq Er EFAULT
130.Fa path
131or
132.Fa name
133points to an invalid address.
134.It Bq Er EIO
135An I/O error occurred while reading from or writing to the file system.
136.El
137.Sh SEE ALSO
138.Xr getxattr 2 ,
2d21ac55
A
139.Xr listxattr 2 ,
140.Xr setxattr 2
91447636
A
141.Sh HISTORY
142.Fn removexattr
143and
144.Fn fremovexattr
145first appeared in Mac OS X 10.4.