aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/passthrough.c')
-rw-r--r--example/passthrough.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/example/passthrough.c b/example/passthrough.c
index f0e686d..fdaa19e 100644
--- a/example/passthrough.c
+++ b/example/passthrough.c
@@ -519,6 +519,24 @@ static off_t xmp_lseek(const char *path, off_t off, int whence, struct fuse_file
return res;
}
+#ifdef HAVE_STATX
+static int xmp_statx(const char *path, int flags, int mask, struct statx *stxbuf,
+ struct fuse_file_info *fi)
+{
+ int fd = -1;
+ int res;
+
+ if (fi)
+ fd = fi->fh;
+
+ res = statx(fd, path, flags | AT_SYMLINK_NOFOLLOW, mask, stxbuf);
+ if (res == -1)
+ return -errno;
+
+ return 0;
+}
+#endif
+
static const struct fuse_operations xmp_oper = {
.init = xmp_init,
.getattr = xmp_getattr,
@@ -556,6 +574,9 @@ static const struct fuse_operations xmp_oper = {
.copy_file_range = xmp_copy_file_range,
#endif
.lseek = xmp_lseek,
+#ifdef HAVE_STATX
+ .statx = xmp_statx,
+#endif
};
int main(int argc, char *argv[])