aboutgitcodelistschat:MatrixIRC
path: root/demo/fsetxattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'demo/fsetxattr.c')
-rw-r--r--demo/fsetxattr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/demo/fsetxattr.c b/demo/fsetxattr.c
new file mode 100644
index 0000000..6ee423a
--- /dev/null
+++ b/demo/fsetxattr.c
@@ -0,0 +1,11 @@
+#include <sys/stat.h>
+#include <sys/xattr.h>
+#include <fcntl.h>
+#include <string.h>
+
+int main(int argc, char **argv)
+{
+ int fd = open(argv[1], O_RDONLY);
+
+ return fsetxattr(fd, argv[2], argv[3], strlen(argv[3]) + 1, 0);
+}