xref: /freebsd/share/man/man9/VOP_LISTEXTATTR.9 (revision 7bd6fde3)
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.\" $FreeBSD$
32.\"
33.Dd August 19, 2005
34.Os
35.Dt VOP_LISTEXTATTR 9
36.Sh NAME
37.Nm VOP_LISTEXTATTR
38.Nd retrieve a list of named extended attribute from a vnode
39.Sh SYNOPSIS
40.In sys/param.h
41.In sys/vnode.h
42.In sys/extattr.h
43.Ft int
44.Fo VOP_LISTEXTATTR
45.Fa "struct vnode *vp"
46.Fa "int attrnamespace"
47.Fa "struct uio *uio"
48.Fa "size_t *size"
49.Fa "struct ucred *cred"
50.Fa "struct thread *td"
51.Fc
52.Sh DESCRIPTION
53This vnode call may be used to retrieve a list of named extended attributes
54from a specified namespace on a file or directory.
55.Pp
56Its arguments are:
57.Bl -tag -width ".Fa attrnamespace"
58.It Fa vp
59The vnode of the file or directory.
60.It Fa attrnamespace
61Integer constant indicating which extended attribute namespace the attribute
62name is present in.
63.It Fa uio
64The location of the data to be read.
65The resulting data will be a list of attribute names.
66Each list entry consists of a single byte containing the length of
67the attribute name, followed by the attribute name.
68The attribute name is not terminated by
69.Tn ASCII
70.Dv NUL .
71.It Fa size
72If not
73.Dv NULL ,
74on return it will contain the number of bytes required to read the list.
75In most cases
76.Fa uio
77will be
78.Dv NULL
79when
80.Fa size
81is not, and vise versa.
82.It Fa cred
83The user credentials to use in authorizing the request.
84.It Fa td
85The thread requesting the extended attribute.
86.El
87.Pp
88The
89.Fa cred
90pointer may be
91.Dv NULL
92to indicate that access control checks are not to be performed, if possible.
93This
94.Fa cred
95setting might be used to allow the kernel to authorize extended attribute
96retrieval that the active process might not be permitted to do.
97.Pp
98Extended attribute semantics may vary by file system implementing the call.
99More information on extended attributes may be found in
100.Xr extattr 9 .
101.Sh LOCKS
102The vnode will be locked on entry and should remain locked on return.
103.Sh RETURN VALUES
104On success, zero will be returned, and the
105.Fa uio
106structure will be updated to
107reflect the list read.
108Otherwise, an appropriate error code is returned.
109.Sh ERRORS
110.Bl -tag -width Er
111.It Bq Er EACCES
112The caller does not have the appropriate privilege.
113.It Bq Er ENXIO
114The request was not valid in this file system for the specified vnode and
115attribute name.
116.It Bq Er ENOMEM
117Sufficient memory is not available to fulfill the request.
118.It Bq Er EFAULT
119The
120.Fa uio
121structure refers to an invalid userspace address.
122.It Bq Er EINVAL
123The
124.Fa namespace
125or
126.Fa uio
127argument is invalid.
128.It Bq Er EOPNOTSUPP
129The file system does not support
130.Fn VOP_LISTEXTATTR .
131.El
132.Sh SEE ALSO
133.Xr extattr 9 ,
134.Xr vnode 9 ,
135.Xr VOP_GETEXTATTR 9 ,
136.Xr VOP_SETEXTATTR 9
137