]> git.proxmox.com Git - ceph.git/blob - ceph/src/test/old/testxattr.cc
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / test / old / testxattr.cc
1
2 #include <iostream>
3 using namespace std;
4
5
6 #include <unistd.h>
7 #include <stdlib.h>
8 #include <sys/types.h>
9 #include <sys/stat.h>
10 #include <fcntl.h>
11 #include <sys/file.h>
12 #include <errno.h>
13 #include <dirent.h>
14 #include <sys/xattr.h>
15
16 int main(int argc, char**argv)
17 {
18 int a = 1;
19 int b = 2;
20
21 mknod("test", 0600, 0);
22
23 cout << "setxattr " << setxattr("test", "asdf", &a, sizeof(a), 0) << endl;
24 cout << "errno " << errno << " " << strerror(errno) << endl;
25 cout << "getxattr " << getxattr("test", "asdf", &b, sizeof(b)) << endl;
26 cout << "errno " << errno << " " << strerror(errno) << endl;
27 cout << "a is " << a << " and b is " << b << endl;
28 return 0;
29 }