xref: /freebsd/share/man/man9/VOP_GETEXTATTR.9 (revision 1b6c76a2fe091c74f08427e6c870851025a9cf67)
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.Os
30.Dt VOP_GETEXTATTR 9
31.Sh NAME
32.Nm VOP_GETEXTATTR
33.Nd retrieve named extended attribute from a vnode
34.Sh SYNOPSIS
35.Fd #include <sys/param.h>
36.Fd #include <sys/vnode.h>
37.Fd #include <sys/extattr.h>
38.Ft int
39.Fn VOP_GETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" "struct uio *uio" "struct ucred *cred" "struct proc *p"
40.Sh DESCRIPTION
41This vnode call may be used to retrieve a specific named extended attribute
42from a file 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 Ar attrnamespace
49integer constant indicating which extended attribute namespace the attribute
50name is present in
51.It Fa name
52pointer to a null-terminated character string containing the attribute name
53.It Fa uio
54the location of the data to be read or written
55.It Fa cred
56the user credentials to use in authorizing the request
57.It Fa p
58the process requesting the extended attribute
59.El
60.Pp
61The
62.Fa cred
63pointer may be
64.Dv NULL
65to indicate that access control checks are not to be performed, if possible.
66This
67.Fa cred
68setting might be used to allow the kernel to authorize extended attribute
69retrieval that the active process might not be permitted to do.
70.Pp
71Extended attribute semantics may vary by file system implementing the call.
72More information on extended attributes may be found in
73.Xr extattr 9 .
74.Sh LOCKS
75The vnode will be locked on entry and should remain locked on return.
76.Sh RETURN VALUES
77On success, zero will be returned, and the uio structure will be updated to
78reflect data read.  Otherwise, an appropriate error code is returned.
79.Sh ERRORS
80.Bl -tag -width Er
81.It Bq Er ENOENT
82The attribute name is not defined for this vnode
83.It Bq Er EACCES
84Permission denied
85.It Bq Er ENXIO
86The request was not valid in this file system for the specified vnode and
87attribute name.
88.It Bq Er ENOMEM
89Insufficient memory available to fulfill request
90.It Bq Er EFAULT
91The uio structure refers to an invalid userspace address.
92.It Bq Er EINVAL
93The
94.Fa name
95or
96.Fa uio
97argument is invalid.
98.It Bq Er EOPNOTSUPP
99The file system does not support
100.Fn VOP_GETEXTATTR
101.El
102.Sh SEE ALSO
103.Xr extattr 9 ,
104.Xr vnode 9 ,
105.Xr VOP_SETEXTATTR 9
106