diff options
author | y <tofik.sonono@intel.com> | 2022-11-14 11:55:39 +0100 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2022-11-15 11:25:49 +0000 |
commit | 777663953382925c7403f0560c28ec9bbd14d7be (patch) | |
tree | 260177c7501d14342b0e1b0b2553a5247c07c750 | |
parent | b1290d4c091a5c590e61a6195e625eab33300673 (diff) | |
download | fuse-777663953382925c7403f0560c28ec9bbd14d7be.tar.gz |
libfuse custom communication interface
libfuse can now be used without having a mount interface.
-rw-r--r-- | include/fuse_lowlevel.h | 19 | ||||
-rw-r--r-- | lib/fuse_lowlevel.c | 4 | ||||
-rw-r--r-- | lib/fuse_versionscript | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 53f0fcf..955482c 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -1955,6 +1955,25 @@ struct fuse_session *fuse_session_new(struct fuse_args *args, size_t op_size, void *userdata); /** + * Set a file descriptor for the session. + * + * This function can be used if you want to have a custom communication + * interface instead of using a mountpoint. In practice, this means that instead + * of calling fuse_session_mount() and fuse_session_unmount(), one could call + * fuse_custom_session_fd() where fuse_session_mount() would have otherwise been + * called. + * + * This function does not open or close any file descriptors, meaning it is the + * responsibility of the caller to provide a valid file descriptor, such as a + * accepted socket. It is also the responsibility to close the socket. + * + * @param se session object + * @param fd file descriptor for the session + * + **/ +void fuse_custom_session_fd(struct fuse_session *se, int fd); + +/** * Mount a FUSE file system. * * @param mountpoint the mount point path diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index e82cd9e..b6ffbd9 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -3009,6 +3009,10 @@ out1: return NULL; } +void fuse_custom_session_fd(struct fuse_session *se, int fd) { + se->fd = fd; +} + int fuse_session_mount(struct fuse_session *se, const char *mountpoint) { int fd; diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index 7e50e75..f57c505 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -39,6 +39,7 @@ FUSE_3.0 { fuse_session_new; fuse_main_real; fuse_mount; + fuse_custom_session_fd; fuse_session_mount; fuse_new; fuse_opt_insert_arg; |