xref: /dragonfly/share/man/man9/VOP_SETEXTATTR.9 (revision c69bf40f)
1.\"-
2.\" Copyright (c) 1999 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: src/share/man/man9/VOP_SETEXTATTR.9,v 1.1.2.3 2001/12/17 11:30:18 ru Exp $
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" "char *name" "struct uio *uio" "struct ucred *cred" "struct proc *p"
40.Sh DESCRIPTION
41This vnode call may be used to set specific named extended attribute for a
42file or directory.
43.Pp
44Its arguments are:
45.Bl -tag -width type
46.It Fa vp
47the vnode of the file or directory
48.It Fa name
49pointer to a null-terminated character string containing the attribute name
50.It Fa uio
51the location of the data to be read or written
52.It Fa cred
53the user credentials to use in authorizing the request
54.It Fa p
55the process setting the extended attribute
56.El
57.Pp
58The uio structure is used in a manner similar to the argument of the same
59name in
60.Xr VOP_WRITE 9 .
61However, as extended attributes provide a strict "name=value" semantic,
62non-zero offsets will be rejected.
63.Pp
64The
65.Fa uio
66pointer may be
67.Dv NULL
68to indicate that the specified extended attribute should be deleted.
69.Pp
70The
71.Fa cred
72pointer may be
73.Dv NULL
74to indicate that access control checks are not to be performed, if possible.
75This
76.Fa cred
77setting might be used to allow the kernel to authorize extended attribute
78changes that the active process might not be permitted to make.
79.Pp
80Extended attribute semantics may vary by file system implementing the call.
81More information on extended attributes may be found in
82.Xr extattr 9 .
83.Sh LOCKS
84The vnode will be locked on entry and should remain locked on return.
85.Sh RETURN VALUES
86If the extended attribute is successfully set, then zero is returned.
87Otherwise, an appropriate error code is returned.
88.Sh ERRORS
89.Bl -tag -width Er
90.It Bq Er EACCES
91Permission denied
92.It Bq Er ENXIO
93The request was not valid in this file system for the specified vnode and
94attribute name.
95.It Bq Er ENOMEM
96Insufficient memory available to fulfill request
97.It Bq Er EFAULT
98The uio structure refers to an invalid userspace address
99.It Bq Er EINVAL
100The name or uio argument is invalid
101.It Bq Er EOPNOTSUPP
102The file system does not support
103.Fn VOP_SETEXTATTR
104.It Bq Er ENOSPC
105The file system is out of space
106.It Bq Er EROFS
107The file system is read-only
108.El
109.Sh SEE ALSO
110.Xr extattr 9 ,
111.Xr vnode 9 ,
112.Xr VOP_GETEXTATTR 9
113.Sh AUTHORS
114This man page was written by
115.An Robert Watson .
116