+void
+listfattr_f(int opno, long r)
+{
+ fent_t *fep;
+ int e;
+ pathname_t f;
+ int v;
+ char *buffer = NULL;
+ int buffer_len;
+
+ init_pathname(&f);
+ if (!get_fname(FT_REGFILE | FT_DIRm, r, &f, NULL, &fep, &v)) {
+ if (v)
+ printf("%d/%d: listfattr - no filename\n", procid, opno);
+ goto out;
+ }
+ check_cwd();
+
+ e = listxattr(f.path, NULL, 0);
+ if (e < 0) {
+ if (v)
+ printf("%d/%d: listfattr %s failed %d\n",
+ procid, opno, f.path, errno);
+ goto out;
+ }
+ buffer_len = e;
+ if (buffer_len == 0) {
+ if (v)
+ printf("%d/%d: listfattr %s - has no extended attributes\n",
+ procid, opno, f.path);
+ goto out;
+ }
+
+ buffer = malloc(buffer_len);
+ if (!buffer) {
+ if (v)
+ printf("%d/%d: listfattr %s failed to allocate buffer with %d bytes\n",
+ procid, opno, f.path, buffer_len);
+ goto out;
+ }
+
+ e = listxattr(f.path, buffer, buffer_len) < 0 ? errno : 0;
+ if (v)
+ printf("%d/%d: listfattr %s buffer length %d %d\n",
+ procid, opno, f.path, buffer_len, e);
+out:
+ free(buffer);
+ free_pathname(&f);
+}
+