diff options
Diffstat (limited to 'example/passthrough_fh.c')
-rw-r--r-- | example/passthrough_fh.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/example/passthrough_fh.c b/example/passthrough_fh.c index 3fc80f8..13eb41e 100644 --- a/example/passthrough_fh.c +++ b/example/passthrough_fh.c @@ -596,6 +596,18 @@ static ssize_t xmp_copy_file_range(const char *path_in, } #endif +static off_t xmp_lseek(const char *path, off_t off, int whence, struct fuse_file_info *fi) +{ + off_t res; + (void) path; + + res = lseek(fi->fh, off, whence); + if (res == -1) + return -errno; + + return res; +} + static struct fuse_operations xmp_oper = { .init = xmp_init, .getattr = xmp_getattr, @@ -643,6 +655,7 @@ static struct fuse_operations xmp_oper = { #ifdef HAVE_COPY_FILE_RANGE .copy_file_range = xmp_copy_file_range, #endif + .lseek = xmp_lseek, }; int main(int argc, char *argv[]) |