xref: /freebsd/share/man/man9/VOP_LISTEXTATTR.9 (revision 4b9d6057)
1.\"-
2.\" Copyright (c) 2003 Network Associates Technology, Inc.
3.\" All rights reserved.
4.\"
5.\" This software was developed for the FreeBSD Project in part by Network
6.\" Associates Laboratories, the Security Research Division of Network
7.\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
8.\" as part of the DARPA CHATS research program.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.Dd August 19, 2005
32.Dt VOP_LISTEXTATTR 9
33.Os
34.Sh NAME
35.Nm VOP_LISTEXTATTR
36.Nd retrieve a list of named extended attributes from a vnode
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/vnode.h
40.In sys/extattr.h
41.Ft int
42.Fo VOP_LISTEXTATTR
43.Fa "struct vnode *vp"
44.Fa "int attrnamespace"
45.Fa "struct uio *uio"
46.Fa "size_t *size"
47.Fa "struct ucred *cred"
48.Fa "struct thread *td"
49.Fc
50.Sh DESCRIPTION
51This vnode call may be used to retrieve a list of named extended attributes
52from a specified namespace on a file or directory.
53.Pp
54Its arguments are:
55.Bl -tag -width ".Fa attrnamespace"
56.It Fa vp
57The vnode of the file or directory.
58.It Fa attrnamespace
59Integer constant indicating which extended attribute namespace the attribute
60name is present in.
61.It Fa uio
62The location of the data to be read.
63The resulting data will be a list of attribute names.
64Each list entry consists of a single byte containing the length of
65the attribute name, followed by the attribute name.
66The attribute name is not terminated by
67.Tn ASCII
68.Dv NUL .
69.It Fa size
70If not
71.Dv NULL ,
72on return it will contain the number of bytes required to read the list.
73In most cases
74.Fa uio
75will be
76.Dv NULL
77when
78.Fa size
79is not, and vice versa.
80.It Fa cred
81The user credentials to use in authorizing the request.
82.It Fa td
83The thread requesting the extended attribute.
84.El
85.Pp
86The
87.Fa cred
88pointer may be
89.Dv NULL
90to indicate that access control checks are not to be performed, if possible.
91This
92.Fa cred
93setting might be used to allow the kernel to authorize extended attribute
94retrieval that the active process might not be permitted to do.
95.Pp
96Extended attribute semantics may vary by file system implementing the call.
97More information on extended attributes may be found in
98.Xr extattr 9 .
99.Sh LOCKS
100The vnode will be locked on entry and should remain locked on return.
101.Sh RETURN VALUES
102On success, zero will be returned, and the
103.Fa uio
104structure will be updated to
105reflect the list read.
106Otherwise, an appropriate error code is returned.
107.Sh ERRORS
108.Bl -tag -width Er
109.It Bq Er EACCES
110The caller does not have the appropriate privilege.
111.It Bq Er ENXIO
112The request was not valid in this file system for the specified vnode and
113attribute name.
114.It Bq Er ENOMEM
115Sufficient memory is not available to fulfill the request.
116.It Bq Er EFAULT
117The
118.Fa uio
119structure refers to an invalid userspace address.
120.It Bq Er EINVAL
121The
122.Fa namespace
123or
124.Fa uio
125argument is invalid.
126.It Bq Er EOPNOTSUPP
127The file system does not support
128.Fn VOP_LISTEXTATTR .
129.El
130.Sh SEE ALSO
131.Xr extattr 9 ,
132.Xr vnode 9 ,
133.Xr VOP_GETEXTATTR 9 ,
134.Xr VOP_SETEXTATTR 9
135