1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
11 #include <sys/types.h>
12 #include <sys/xattr.h>
14 int main(int argc, char **argv)
21 fprintf(stderr, "usage: %s <testfile> [bufsize]\n", argv[0]);
26 bufsize = strtoul(argv[2], NULL, 10);
34 bufsize = listxattr(argv[1], NULL, 0);
41 buf = malloc(bufsize);
47 ret = listxattr(argv[1], buf, bufsize);
52 while (l < (buf + ret)) {
53 printf("xattr: %s\n", l);
54 l = strchr(l, '\0') + 1;