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