aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorMark Glines <mark@glines.org>2002-01-07 16:32:02 +0000
committerMark Glines <mark@glines.org>2002-01-07 16:32:02 +0000
commitd84b39ac42882a2cc2e7f85ed5f02ada03744d9e (patch)
tree2af8738e204bdd4f3057fbaf0946ab56447068ff /example
parent6ebe234cc8160d7540add80a75cc7772e08236f5 (diff)
downloadandroid_external_fuse-d84b39ac42882a2cc2e7f85ed5f02ada03744d9e.tar.gz
android_external_fuse-d84b39ac42882a2cc2e7f85ed5f02ada03744d9e.tar.bz2
android_external_fuse-d84b39ac42882a2cc2e7f85ed5f02ada03744d9e.zip
Added statfs support to kernel, lib, examples, and perl
other minor perl fixes (still unstable)
Diffstat (limited to 'example')
-rw-r--r--example/fusexmp.c11
-rw-r--r--example/hello.c1
-rw-r--r--example/null.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c
index b9df79c..b921d56 100644
--- a/example/fusexmp.c
+++ b/example/fusexmp.c
@@ -17,6 +17,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
+#include <sys/statfs.h>
static int xmp_getattr(const char *path, struct stat *stbuf)
{
@@ -231,6 +232,15 @@ static int xmp_write(const char *path, const char *buf, size_t size,
return res;
}
+static int xmp_statfs(struct statfs *fst)
+{
+ struct statfs st;
+ int rv = statfs("/",&st);
+ if(!rv)
+ memcpy(fst,&st,sizeof(st));
+ return rv;
+}
+
static struct fuse_operations xmp_oper = {
getattr: xmp_getattr,
readlink: xmp_readlink,
@@ -249,6 +259,7 @@ static struct fuse_operations xmp_oper = {
open: xmp_open,
read: xmp_read,
write: xmp_write,
+ statfs: xmp_statfs,
};
int main(int argc, char *argv[])
diff --git a/example/hello.c b/example/hello.c
index e0010cd..ccd4b5f 100644
--- a/example/hello.c
+++ b/example/hello.c
@@ -84,6 +84,7 @@ static struct fuse_operations hello_oper = {
open: hello_open,
read: hello_read,
write: NULL,
+ statfs: NULL,
};
int main(int argc, char *argv[])
diff --git a/example/null.c b/example/null.c
index 7be4ab4..71e9a19 100644
--- a/example/null.c
+++ b/example/null.c
@@ -64,6 +64,11 @@ static int null_write(const char *path, const char *UNUSED(buf), size_t size,
return size;
}
+static int null_statfs(struct statfs *st)
+{
+ return st->f_blocks = st->f_bavail = st->f_bsize = st->f_files =
+ st->f_ffree = st->f_namelen = 0;
+}
static struct fuse_operations null_oper = {
getattr: null_getattr,
@@ -83,6 +88,7 @@ static struct fuse_operations null_oper = {
open: null_open,
read: null_read,
write: null_write,
+ statfs: null_statfs,
};
int main(int argc, char *argv[])