• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  #include "tests.h"
2  
3  #ifdef HAVE_SYS_XATTR_H
4  
5  # include <stdio.h>
6  # include <sys/xattr.h>
7  
8  int
main(void)9  main(void)
10  {
11  	static const char name[] = "strace.test";
12  	static const char c_value[] = "foobar";
13  
14  	const char *const z_value = tail_memdup(c_value, sizeof(c_value));
15  	long rc;
16  
17  	rc = fsetxattr(-1, name, z_value, sizeof(c_value), XATTR_REPLACE);
18  	printf("fsetxattr(-1, \"%.*s\"..., \"%.*s\"..., %u, XATTR_REPLACE) = %s\n",
19  	       4, name, 4, c_value, (unsigned) sizeof(c_value), sprintrc(rc));
20  
21  
22  	puts("+++ exited with 0 +++");
23  	return 0;
24  }
25  
26  #else
27  
28  SKIP_MAIN_UNDEFINED("HAVE_SYS_XATTR_H")
29  
30  #endif
31