~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/test/old/testxattr.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 <iostream>
 
13
#include <errno.h>
 
14
#include <dirent.h>
 
15
#include <sys/xattr.h>
 
16
 
 
17
int main(int argc, char**argv)
 
18
{
 
19
  int a = 1;
 
20
  int b = 2;
 
21
 
 
22
  mknod("test", 0600, 0);
 
23
 
 
24
  cout << "setxattr " << setxattr("test", "asdf", &a, sizeof(a), 0) << endl;
 
25
  cout << "errno " << errno << " " << strerror(errno) << endl;
 
26
  cout << "getxattr " << getxattr("test", "asdf", &b, sizeof(b)) << endl;
 
27
  cout << "errno " << errno << " " << strerror(errno) << endl;
 
28
  cout << "a is " << a << " and b is " << b << endl;
 
29
  return 0;
 
30
}