Skip to content

Instantly share code, notes, and snippets.

@taraijpn
Created September 25, 2014 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taraijpn/8f3d92f087d659fb7e00 to your computer and use it in GitHub Desktop.
Save taraijpn/8f3d92f087d659fb7e00 to your computer and use it in GitHub Desktop.
listxattr() test
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/xattr.h>
main(int ac, char *av[])
{
int eno = 0;
ssize_t rv = 0;
rv = listxattr(av[0], NULL, 0);
if (rv < 0) {
eno = errno;
printf("Error listxattr(): %s\n", strerror(eno));
}
printf("listxattr(\"%s\", NULL, 0) = %d\n", av[0], rv);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment