From 2e50d4376f3124a87d5723ae66c09fa71c7ecf88 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 20 Dec 2001 12:17:25 +0000 Subject: preparations for cred checking in fs --- include/fuse.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'include/fuse.h') diff --git a/include/fuse.h b/include/fuse.h index 700569c..bafa182 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -83,6 +83,12 @@ struct fuse_operations { int (*write) (const char *, const char *, size_t, off_t); }; +/** Extra context that may be needed by some filesystems */ +struct fuse_context { + uid_t uid; + gid_t gid; +}; + /* FUSE flags: */ /** Enable debuging output */ @@ -97,20 +103,10 @@ extern "C" { * * @param fd the control file descriptor * @param flags any combination of the FUSE flags defined above, or 0 - * @return the created FUSE handle - */ -struct fuse *fuse_new(int fd, int flags); - -/** - * Set the filesystem operations. - * - * Operations which are initialised to NULL will return ENOSYS to the - * calling process. - * - * @param f the FUSE handle * @param op the operations + * @return the created FUSE handle */ -void fuse_set_operations(struct fuse *f, const struct fuse_operations *op); +struct fuse *fuse_new(int fd, int flags, const struct fuse_operations *op); /** * FUSE event loop. @@ -146,6 +142,17 @@ void fuse_loop_mt(struct fuse *f); */ void fuse_destroy(struct fuse *f); +/** + * Get the current context + * + * The context is only valid for the duration of a filesystem + * operation, and thus must not be stored and used later. + * + * @param f the FUSE handle + * @return the context + */ +struct fuse_context *fuse_get_context(struct fuse *f); + /* ----------------------------------------------------------- * * Miscellaneous helper fuctions * * ----------------------------------------------------------- */ -- cgit v1.2.3