VOP_LISTEXTATTR(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… VOP_LISTEXTATTR(9) πŸ’…

okay so bestie, welcome to this page from the Kernel Developer's Manual. We're doing VOP_LISTEXTATTR, and it's literally the vnode operation for retrieving a list of named extended attributes. group chat, but make it kernel. 🫢


✨ NAME ✨

VOP_LISTEXTATTR β€” retrieve a list of named extended attributes from a vnode. That's the assignment, and it ate. πŸ’–

🌸 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);

πŸ¦‹ DESCRIPTION πŸ¦‹

So this vnode call may be used to retrieve a list of named extended attributes from a specified namespace on a file or directory. yes, file or directory β€” main character energy for both. ✨

Its arguments are:

  • vp β€” the vnode of the file or directory. your little kernel object bestie.
  • 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 no, the attribute name is not terminated by ASCII NUL. not me assuming there'd be a NUL 😭
  • size β€” if not NULL, on return it will contain the number of bytes required to read the list. in most cases uio will be NULL when size is not, and vice versa.
  • cred β€” the user credentials to use in authorizing the request.
  • td β€” the thread requesting the extended attribute.

The cred pointer 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 it's giving "kernel has a hall pass, but only if possible" 🫢

Extended attribute semantics may vary by file system implementing the call. More information on extended attributes may be found in extattr(9). iykyk.

πŸ”’ LOCKS πŸ”’

The vnode will be locked on entry and should remain locked on return. so like, it enters locked and leaves locked β€” no cap. πŸ”

πŸŽ€ RETURN VALUES πŸŽ€

On success, zero will be returned, and the uio structure will be updated to reflect the list read. Otherwise, an appropriate error code is returned. that's it, that's the vibe check.

πŸ’€ ERRORS πŸ’€

  • [EACCES] β€” the caller does not have the appropriate privilege. rude, but fair.
  • [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. the audacity 😭
  • [EFAULT] β€” the uio structure refers to an invalid userspace address.
  • [EINVAL] β€” the namespace or uio argument is invalid.
  • [EOPNOTSUPP] β€” the file system does not support VOP_LISTEXTATTR().

πŸ‘‘ SEE ALSO πŸ‘‘


mwah πŸ’‹ this one is from Debian, dated August 19, 2005, and it's literally the VOP_LISTEXTATTR(9) page. byeee bestie 🫢✨

πŸ“¦ where this page comes from