Conversation

Getting and setting filesystem extended attributes is pretty straightforward. Listing them isn't. There's more than meets the eye, and the documentation is pretty slim.
2
8
Replying to
You need to pass a buffer to listxattr and then iterate over the NUL-terminated strings. The return value tells you when to stop so you know how many times you need to look past the NUL terminator for another string. At least on Linux, it has a limit on how much it can return.
1
2