7 #include <attr/xattr.h>
13 int main(int argc, char **argv)
19 printf("usage: ea FILE\n");
23 printf("Setting ea on \"%s\"\n", argv[1]);
26 if (setxattr(argv[1], "user.test", buf, sizeof(buf), 0) != 0) {
27 printf("setxattr: %s, %d\n", strerror(errno), errno);
30 if (lsetxattr(argv[1], "user.test", buf, sizeof(buf), 0) != 0) {
31 printf("lsetxattr: %s, %d\n", strerror(errno), errno);
34 if (llistxattr(argv[1], NULL, 0) == -1) {
35 printf("llistxattr: %s, %d\n", strerror(errno), errno);
38 if ((fd = attropen(argv[1], "ea", O_RDWR | O_NOFOLLOW, 0)) == -1) {
39 printf("attropen(AT_SYMLINK_NOFOLLOW): %s, %d\n", strerror(errno), errno);
42 if ((fd = open(argv[1], O_RDONLY | O_NOFOLLOW)) == -1) {
43 printf("open(O_NOFOLLOW): %s, %d\n", strerror(errno), errno);