simple_xattr_list(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… simple_xattr_list β€” the kernel API manual, but make it cute

okay so bestie, welcome to simple_xattr_list(9) from the Kernel API Manual. this is the function that lists all your xattr objects, and honestly? it's giving "quietly essential." let's get into it 🫢


✨ NAME ✨

simple_xattr_list β€” literally just lists all xattr objects. that's the whole vibe. no cap. πŸ“‹


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t simple_xattr_list (struct inode *inode , struct list_head
*xattrs , char *buffer , size_t size );

🌸 ARGUMENTS 🌸

  • inode β€” the inode you're pulling the xattrs from. your main character source, iykyk.
  • xattrs β€” the header of the xattr object. yes, the header. it's the entry point πŸ’«
  • buffer β€” the buffer where all the xattrs get stored. the little home for your data 🏠
  • size β€” the size of buffer. gotta know how much room you're working with, periodt.

πŸŽ€ DESCRIPTION πŸŽ€

So what does it actually do? It lists all xattrs associated with inode. If buffer is NULL, we return the required size of the buffer β€” like, "here's how much space you're gonna need, bestie." πŸ“

If buffer is provided, we store the xattrs value into it, provided it is big enough. (emphasis on big enough, don't come at it with a tiny buffer πŸ™ˆ)

⚠️ ok important heads up: the number of xattr names that can be listed with listxattr(2) is limited to XATTR_LIST_MAX aka 65536 bytes. If a larger buffer is passed, then vfs_listxattr caps it to XATTR_LIST_MAX, and if more xattr names are found it will return -E2BIG. so like... don't try to be extra with a huge buffer, it will not slay πŸ’€

πŸ”₯ RETURN πŸ”₯

On success, you get the required size or the size of the copied xattrs returned. On error, a negative error code comes back at you. simple as that ✨


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/xattr.c may write_xattr(9), __vfs_setxattr_noperm(9), __vfs_setxattr_locked(9), vfs_listxattr(9), __vfs_removexattr_locked(9), generic_listxattr(9), xattr_full_name(9), simple_xattr_space(9), simple_xattr_free(9), simple_xattr_free_rcu(9), simple_xattr_alloc(9), simple_xattr_get(9), simple_xattr_set(9), simple_xattr_set_limited(9), simple_xattr_add(9), simple_xattr_add_limited(9), simple_xattrs_free(9), and simple_xattr_cache_cleanup(9) β€” go read the whole friend group, they're all iconic in their own way πŸ’œ


and that's the tea!! πŸ“ this page lives over in ./fs, dated October 2026, and it's part of the Kernel API Manual β€” mwah, love that for us. now go list some xattrs, bestie, you've got this πŸ’…πŸ’–

πŸ“¦ where this page comes from