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$ 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" "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 Ar vp 47the vnode of the file or directory 48.It Ar name 49pointer to a null-terminated character string containing the attribute name 50.It Ar uio 51the location of the data to be read or written 52.It Ar cred 53the user credentials to use in authorizing the request 54.It Ar p 55the process requesting the extended attribute 56.El 57.Pp 58The 59.Fa cred 60pointer may be NULL to indicate that access control checks are not to be 61performed, of possible. This cred setting might be used to allow the 62kernel to authorize extended attribute retrieval that the active process 63might not be permitted to do. 64.Pp 65Extended attribute semantics may vary by file system implementing the call. 66More information on extended attributes may be found in 67.Xr extattr 9 . 68.Sh LOCKS 69No locks are required to call this vnode method, and any locks held on 70entry will be held on exit. 71.Sh RETURN VALUES 72On success, zero will be returned, and the uio structure will be updated to 73reflect data read. Otherwise, an appropriate error code is returned. 74.Sh ERRORS 75.Bl -tag -width Er 76.It Bq Er ENOENT 77The attribute name is not defined for this vnode 78.It Bq Er EACCES 79Permission denied 80.It Bq Er ENXIO 81The request was not valid in this file system for the specified vnode and 82attribute name. 83.It Bq Er ENOMEM 84Insufficient memory available to fulfill request 85.It Bq Er EFAULT 86The uio structure refers to an invalid userspace address. 87.It Bq Er EINVAL 88The 89.Fa name 90or 91.Fa uio 92argument is invalid. 93.It Bq Er EOPNOTSUPP 94The file system does not support VOP_GETEXTATTR 95.El 96.Sh SEE ALSO 97.Xr extattr 9 , 98.Xr vnode 9 , 99.Xr VOP_SETEXTATTR 9 100