]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man9/VOP_SETEXTATTR.9
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man9 / VOP_SETEXTATTR.9
1 .\"-
2 .\" Copyright (c) 1999, 2000, 2001 Robert N. M. Watson
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd December 23, 1999
29 .Dt VOP_SETEXTATTR 9
30 .Os
31 .Sh NAME
32 .Nm VOP_SETEXTATTR
33 .Nd set named extended attribute for a vnode
34 .Sh SYNOPSIS
35 .In sys/param.h
36 .In sys/vnode.h
37 .In sys/extattr.h
38 .Ft int
39 .Fn VOP_SETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" "struct uio *uio" "struct ucred *cred" "struct thread *td"
40 .Sh DESCRIPTION
41 This vnode call may be used to set specific named extended attribute for a
42 file or directory.
43 .Pp
44 Its arguments are:
45 .Bl -tag -width type
46 .It Fa vp
47 The vnode of the file or directory.
48 .It Fa attrnamespace
49 Integer constant indicating which extended attribute namespace the attribute
50 name is present in.
51 .It Fa name
52 Pointer to a null-terminated character string containing the attribute name.
53 .It Fa uio
54 The location of the data to be read or written.
55 .It Fa cred
56 The user credentials to use in authorizing the request.
57 .It Fa td
58 The thread setting the extended attribute.
59 .El
60 .Pp
61 The uio structure is used in a manner similar to the argument of the same
62 name in
63 .Xr VOP_WRITE 9 .
64 However, as extended attributes provide a strict "name=value" semantic,
65 non-zero offsets will be rejected.
66 .Pp
67 The
68 .Fa uio
69 pointer may be
70 .Dv NULL
71 to indicate that the specified extended attribute should be deleted.
72 .Pp
73 The
74 .Fa cred
75 pointer may be
76 .Dv NULL
77 to indicate that access control checks are not to be performed, if possible.
78 This
79 .Fa cred
80 setting might be used to allow the kernel to authorize extended attribute
81 changes that the active process might not be permitted to make.
82 .Pp
83 Extended attribute semantics may vary by file system implementing the call.
84 More information on extended attributes may be found in
85 .Xr extattr 9 .
86 .Sh LOCKS
87 The vnode will be locked on entry and should remain locked on return.
88 .Sh RETURN VALUES
89 If the extended attribute is successfully set, then zero is returned.
90 Otherwise, an appropriate error code is returned.
91 .Sh ERRORS
92 .Bl -tag -width Er
93 .It Bq Er EACCES
94 The caller does not have the appropriate privilege.
95 .It Bq Er ENXIO
96 The request was not valid in this file system for the specified vnode and
97 attribute name.
98 .It Bq Er ENOMEM
99 Insufficient memory available to fulfill the request.
100 .It Bq Er EFAULT
101 The uio structure refers to an invalid userspace address.
102 .It Bq Er EINVAL
103 The name, namespace, or uio argument is invalid.
104 .It Bq Er EOPNOTSUPP
105 The file system does not support
106 .Fn VOP_SETEXTATTR .
107 .It Bq Er ENOSPC
108 The file system is out of space.
109 .It Bq Er EROFS
110 The file system is read-only.
111 .El
112 .Sh SEE ALSO
113 .Xr extattr 9 ,
114 .Xr vnode 9 ,
115 .Xr VOP_GETEXTATTR 9 ,
116 .Xr VOP_LISTEXTATTR 9
117 .Sh AUTHORS
118 This manual page was written by
119 .An Robert Watson .