From d735af94fa54a5555ce725f1d4e6b97b812b6603 Mon Sep 17 00:00:00 2001 From: Yuri Per Date: Sun, 3 Nov 2019 11:44:31 +0200 Subject: Implement lseek operation (#457) --- example/passthrough_ll.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'example/passthrough_ll.c') diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c index 0f1fda5..5372d02 100644 --- a/example/passthrough_ll.c +++ b/example/passthrough_ll.c @@ -1161,6 +1161,19 @@ static void lo_copy_file_range(fuse_req_t req, fuse_ino_t ino_in, off_t off_in, } #endif +static void lo_lseek(fuse_req_t req, fuse_ino_t ino, off_t off, int whence, + struct fuse_file_info *fi) +{ + off_t res; + + (void)ino; + res = lseek(fi->fh, off, whence); + if (res != -1) + fuse_reply_lseek(req, res); + else + fuse_reply_err(req, errno); +} + static struct fuse_lowlevel_ops lo_oper = { .init = lo_init, .lookup = lo_lookup, @@ -1198,6 +1211,7 @@ static struct fuse_lowlevel_ops lo_oper = { #ifdef HAVE_COPY_FILE_RANGE .copy_file_range = lo_copy_file_range, #endif + .lseek = lo_lseek, }; int main(int argc, char *argv[]) -- cgit v1.2.3