aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2005-10-26 12:53:25 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2005-10-26 12:53:25 +0000
commitb0b13d1e5499e20382ad74e202160d49e1792ee8 (patch)
tree77c9dbbceda8149929fed4e66411b49a405808cf /example
parentc4c12ae295ca6f3fb02e12d3bad8f92fee4dfe3f (diff)
add access operation
Diffstat (limited to 'example')
-rw-r--r--example/fusexmp.c12
-rw-r--r--example/fusexmp_fh.c12
2 files changed, 24 insertions, 0 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c
index 1ef0ac3..1732556 100644
--- a/example/fusexmp.c
+++ b/example/fusexmp.c
@@ -36,6 +36,17 @@ static int xmp_getattr(const char *path, struct stat *stbuf)
return 0;
}
+static int xmp_access(const char *path, int mask)
+{
+ int res;
+
+ res = access(path, mask);
+ if(res == -1)
+ return -errno;
+
+ return 0;
+}
+
static int xmp_readlink(const char *path, char *buf, size_t size)
{
int res;
@@ -319,6 +330,7 @@ static int xmp_removexattr(const char *path, const char *name)
static struct fuse_operations xmp_oper = {
.getattr = xmp_getattr,
+ .access = xmp_access,
.readlink = xmp_readlink,
.readdir = xmp_readdir,
.mknod = xmp_mknod,
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c
index f1c08f8..d17699e 100644
--- a/example/fusexmp_fh.c
+++ b/example/fusexmp_fh.c
@@ -33,6 +33,17 @@ static int xmp_getattr(const char *path, struct stat *stbuf)
return 0;
}
+static int xmp_access(const char *path, int mask)
+{
+ int res;
+
+ res = access(path, mask);
+ if(res == -1)
+ return -errno;
+
+ return 0;
+}
+
static int xmp_readlink(const char *path, char *buf, size_t size)
{
int res;
@@ -317,6 +328,7 @@ static int xmp_removexattr(const char *path, const char *name)
static struct fuse_operations xmp_oper = {
.getattr = xmp_getattr,
+ .access = xmp_access,
.readlink = xmp_readlink,
.opendir = xmp_opendir,
.readdir = xmp_readdir,