simple_xattr_list(9)
π 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 ofbuffer. 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 withlistxattr(2)is limited toXATTR_LIST_MAXaka65536bytes. If a larger buffer is passed, thenvfs_listxattrcaps it toXATTR_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms