aboutsummaryrefslogtreecommitdiffstats
path: root/example/fusexmp_fh.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-08-25 15:19:06 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-08-25 15:19:06 +0000
commitecce1bf2ff73eb37048a784df0fa97ad041c6bdd (patch)
tree21d192874d6e9ad229f3fbd74abd9e6cb0abe61b /example/fusexmp_fh.c
parentb0c52c59f710b4619949adfc359dabfca005fe0d (diff)
downloadlibfuse-ecce1bf2ff73eb37048a784df0fa97ad041c6bdd.tar.gz
fix
Diffstat (limited to 'example/fusexmp_fh.c')
-rw-r--r--example/fusexmp_fh.c15
1 files changed, 15 insertions, 0 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,