diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/fusexmp_fh.c | 15 | ||||
-rw-r--r-- | example/hello_ll.c | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c index a1d2283..17bd77e 100644 --- a/example/fusexmp_fh.c +++ b/example/fusexmp_fh.c @@ -193,6 +193,20 @@ static int xmp_truncate(const char *path, off_t size) return 0; } +static int xmp_ftruncate(const char *path, off_t size, + struct fuse_file_info *fi) +{ + int res; + + (void) path; + + res = ftruncate(fi->fh, size); + if(res == -1) + return -errno; + + return 0; +} + static int xmp_utime(const char *path, struct utimbuf *buf) { int res; @@ -353,6 +367,7 @@ static struct fuse_operations xmp_oper = { .chmod = xmp_chmod, .chown = xmp_chown, .truncate = xmp_truncate, + .ftruncate = xmp_ftruncate, .utime = xmp_utime, .open = xmp_open, .read = xmp_read, diff --git a/example/hello_ll.c b/example/hello_ll.c index f5a2baf..882f2cd 100644 --- a/example/hello_ll.c +++ b/example/hello_ll.c @@ -40,10 +40,13 @@ static int hello_stat(fuse_ino_t ino, struct stat *stbuf) return 0; } -static void hello_ll_getattr(fuse_req_t req, fuse_ino_t ino) +static void hello_ll_getattr(fuse_req_t req, fuse_ino_t ino, + struct fuse_file_info *fi) { struct stat stbuf; + (void) fi; + memset(&stbuf, 0, sizeof(stbuf)); if (hello_stat(ino, &stbuf) == -1) fuse_reply_err(req, ENOENT); |