aboutsummaryrefslogtreecommitdiff
path: root/example/ioctl.c
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-15 18:46:27 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-15 18:46:27 -0700
commit73b6ff4b75cf1228ea61262c293fcb2fda5dfeea (patch)
tree059d5dbe8d2549f5bf363c6174c5887d44f1ee42 /example/ioctl.c
parentd49f2e77b4741706ec125cc62ea913ed5d39bd39 (diff)
Pass fuse_file_info to getattr, chown, chmod, truncate, utimens handlers
This obsoletes the ftruncate & fgetattr handlers. Fixes #58.
Diffstat (limited to 'example/ioctl.c')
-rw-r--r--example/ioctl.c8
1 files changed, 6 insertions, 2 deletions
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;