aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-09-10 20:53:36 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2006-09-10 20:53:36 +0000
commit0c59ebfc9b811c60fcf808a5de33320eeeb394af (patch)
tree3f906a752cc13a2f46b177b6a8fdcd9df2503309 /example
parent349bdda3524368ee30dc92cafb6914717017fcdd (diff)
downloadlibfuse-0c59ebfc9b811c60fcf808a5de33320eeeb394af.tar.gz
ulockmgr
Diffstat (limited to 'example')
-rw-r--r--example/Makefile.am6
-rw-r--r--example/fusexmp_fh.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/example/Makefile.am b/example/Makefile.am
index 1f31cfc..9fe35e8 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -3,9 +3,5 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
noinst_PROGRAMS = fusexmp fusexmp_fh null hello hello_ll
-fusexmp_SOURCES = fusexmp.c
-fusexmp_fh_SOURCES = fusexmp_fh.c
-null_SOURCES = null.c
-hello_SOURCES = hello.c
-
LDADD = ../lib/libfuse.la -lpthread
+fusexmp_fh_LDADD = ../lib/libfuse.la ../lib/libulockmgr.la -lpthread
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c
index 5ede6db..047ad09 100644
--- a/example/fusexmp_fh.c
+++ b/example/fusexmp_fh.c
@@ -11,6 +11,7 @@
#define _GNU_SOURCE
#include <fuse.h>
+#include <ulockmgr.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -400,6 +401,14 @@ static int xmp_removexattr(const char *path, const char *name)
}
#endif /* HAVE_SETXATTR */
+static int xmp_lock(const char *path, struct fuse_file_info *fi, int cmd,
+ struct flock *lock, uint64_t owner)
+{
+ (void) path;
+
+ return ulockmgr_op(fi->fh, cmd, lock, &owner, sizeof(owner));
+}
+
static struct fuse_operations xmp_oper = {
.getattr = xmp_getattr,
.fgetattr = xmp_fgetattr,
@@ -434,6 +443,7 @@ static struct fuse_operations xmp_oper = {
.listxattr = xmp_listxattr,
.removexattr= xmp_removexattr,
#endif
+ .lock = xmp_lock,
};
int main(int argc, char *argv[])