From 73b6ff4b75cf1228ea61262c293fcb2fda5dfeea Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Sat, 15 Oct 2016 18:46:27 -0700 Subject: Pass fuse_file_info to getattr, chown, chmod, truncate, utimens handlers This obsoletes the ftruncate & fgetattr handlers. Fixes #58. --- example/ioctl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'example/ioctl.c') diff --git a/example/ioctl.c b/example/ioctl.c index ee58f03..0a4c14d 100644 --- a/example/ioctl.c +++ b/example/ioctl.c @@ -83,8 +83,10 @@ static int fioc_file_type(const char *path) return FIOC_NONE; } -static int fioc_getattr(const char *path, struct stat *stbuf) +static int fioc_getattr(const char *path, struct stat *stbuf, + struct fuse_file_info *fi) { + (void) fi; stbuf->st_uid = getuid(); stbuf->st_gid = getgid(); stbuf->st_atime = stbuf->st_mtime = time(NULL); @@ -160,8 +162,10 @@ static int fioc_write(const char *path, const char *buf, size_t size, return fioc_do_write(buf, size, offset); } -static int fioc_truncate(const char *path, off_t size) +static int fioc_truncate(const char *path, off_t size, + struct fuse_file_info *fi) { + (void) fi; if (fioc_file_type(path) != FIOC_FILE) return -EINVAL; -- cgit v1.2.3