diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-10-26 16:04:04 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-10-26 16:04:04 +0000 |
commit | 11509ce3fc6a36b6e3c094bf8aa11820f17d0ede (patch) | |
tree | 7b7584927fab4174852d5c650834326e3f7a8a37 /example | |
parent | d9079a75b14b73e7953adf4958709b1e5ab3804c (diff) | |
download | android_external_fuse-11509ce3fc6a36b6e3c094bf8aa11820f17d0ede.tar.gz android_external_fuse-11509ce3fc6a36b6e3c094bf8aa11820f17d0ede.tar.bz2 android_external_fuse-11509ce3fc6a36b6e3c094bf8aa11820f17d0ede.zip |
add ftruncate() method
Diffstat (limited to 'example')
-rw-r--r-- | example/fusexmp_fh.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c index 262a868..2f4b187 100644 --- a/example/fusexmp_fh.c +++ b/example/fusexmp_fh.c @@ -204,6 +204,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; @@ -354,6 +368,7 @@ static struct fuse_operations xmp_oper = { .chmod = xmp_chmod, .chown = xmp_chown, .truncate = xmp_truncate, + .ftruncate = xmp_ftruncate, .utime = xmp_utime, .create = xmp_create, .open = xmp_open, |