]> git.saurik.com Git - apple/xnu.git/blame - bsd/man/man2/removexattr.2
xnu-1228.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
41.Fn Removexattr
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.
62.El
63.Pp
64.Fn fremovexattr
65is identical to
66.Fn removexattr ,
67except that it removes an extended attribute from an open file referenced
68by file descriptor
69.Fa fd .
70.Sh RETURN VALUES
71On success, 0 is returned. On failure, -1 is returned and the global
72variable
73.Va errno
74is set as follows.
75.Sh ERRORS
76.Bl -tag -width Er
77.It Bq Er ENOATTR
78The specified extended attribute does not exist.
79.It Bq Er ENOTSUP
80The file system does not support extended attributes or has the feature
81disabled.
82.It Bq Er EROFS
83The file system is mounted read-only.
84.It Bq Er EPERM
85This type of object does not support extended attributes.
86.It Bq Er EINVAL
87.Fa name
88or
89.Fa options
90is invalid.
91.Fa name
92must be valid UTF-8
93.Fa options
94must make sense.
95.It Bq Er ENOTDIR
96A component of the
97.Fa path 's
98prefix is not a directory.
99.It Bq Er ENAMETOOLONG
100.Fa Name
101exceeded
102.Dv XATTR_MAXNAMELEN
103UTF-8 bytes, or a component of
104.Fa path
105exceeded
106.Dv NAME_MAX
107characters, or the entire
108.Fa path
109exceeded
110.Dv PATH_MAX
111characters.
112.It Bq Er EACCES
113Search permission is denied for a component
114.Fa path
115or permission to remove the attribute is denied.
116.It Bq Er ELOOP
117Too many symbolic links were encountered in
118.Fa path .
119.It Bq Er EFAULT
120.Fa path
121or
122.Fa name
123points to an invalid address.
124.It Bq Er EIO
125An I/O error occurred while reading from or writing to the file system.
126.El
127.Sh SEE ALSO
128.Xr getxattr 2 ,
2d21ac55
A
129.Xr listxattr 2 ,
130.Xr setxattr 2
91447636
A
131.Sh HISTORY
132.Fn removexattr
133and
134.Fn fremovexattr
135first appeared in Mac OS X 10.4.