VOP_LISTEXTATTR(9)
π VOP_LISTEXTATTR β the Kernel Developer's Manual girlies know her π
okay so bestie, welcome to VOP_LISTEXTATTR(9), straight out of the Kernel Developer's Manual. this is the page where we learn how to β¨retrieve a list of named extended attribute from a vnodeβ¨ (yes the original grammar says "attribute" singular, we're keeping it, no cap). sit down, hydrate, let's go π«Ά
πΈ NAME πΈ
VOP_LISTEXTATTR β retrieve a list of named extended attribute from a vnode
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/extattr.h>
int
VOP_LISTEXTATTR(struct vnode *vp, int attrnamespace, struct uio *uio,
size_t *size, struct ucred *cred, struct thread *td);
like look at that signature. iconic. no notes π
π¦ DESCRIPTION π¦
so this vnode call is literally the one you use to retrieve a list of named extended attributes from a specified namespace on a file or directory. main character behavior fr fr.
its arguments are, in order, because we do not skip a single one:
vpβ the vnode of the file or directory. your target. your girl.attrnamespaceβ an integer constant indicating which extended attribute namespace the attribute name is present in.uioβ the location of the data to be read. the resulting data will be a list of attribute names. each list entry consists of a single byte containing the length of the attribute name, followed by the attribute name. and hear me on this: the attribute name is not terminated by ASCII NUL. no NUL. zero NULs. don't come for me.sizeβ if notNULL, on return it will contain the number of bytes required to read the list. and in most casesuiowill beNULLwhensizeis not, and vice versa. they're giving "you can't sit with us" energy, but like, functionally.credβ the user credentials to use in authorizing the request.tdβ the thread requesting the extended attribute.
and here's the tea about that cred pointer: it may be NULL to indicate that access control checks are not to be performed, if possible. this cred setting might be used to allow the kernel to authorize extended attribute retrieval that the active process might not be permitted to do. so like, the kernel gets a hall pass π
extended attribute semantics may vary by file system implementing the call. more information on extended attributes may be found in extattr(9). every fs is a different girl, respect it.
π LOCKS π
the vnode will be locked on entry and should remain locked on return. do not let go. she's yours, hold her the whole time, periodt. π
β RETURN VALUES β
on success, zero will be returned, and the uio structure will be updated to reflect the list read. slay. otherwise, an appropriate error code is returned, and you go cry about it (affectionately).
π ERRORS π
[EACCES]β the caller does not have the appropriate privilege. not your moment bestie.[ENXIO]β the request was not valid in this file system for the specified vnode and attribute name.[ENOMEM]β sufficient memory is not available to fulfill the request. tragic.[EFAULT]β theuiostructure refers to an invalid userspace address. that address is not real, she's imaginary π[EINVAL]β the namespace oruioargument is invalid.[EOPNOTSUPP]β the file system does not supportVOP_LISTEXTATTR(). this fs said "not my genre" π
π SEE ALSO π
extattr(9), vnode(9), VOP_GETEXTATTR(9), VOP_SETEXTATTR(9) β go read the whole friend group, they're all iconic.
and that's the page, babe π this one shipped from Debian, dated August 19, 2005, and it still ate. mwah. go list some extended attributes, you got this. πβ¨π¦
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2003 Network Associates Technology, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms