diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-09-10 20:53:36 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-09-10 20:53:36 +0000 |
commit | 0c59ebfc9b811c60fcf808a5de33320eeeb394af (patch) | |
tree | 3f906a752cc13a2f46b177b6a8fdcd9df2503309 /example/fusexmp_fh.c | |
parent | 349bdda3524368ee30dc92cafb6914717017fcdd (diff) | |
download | libfuse-0c59ebfc9b811c60fcf808a5de33320eeeb394af.tar.gz |
ulockmgr
Diffstat (limited to 'example/fusexmp_fh.c')
-rw-r--r-- | example/fusexmp_fh.c | 10 |
1 files changed, 10 insertions, 0 deletions
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[]) |