aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-11-23 16:00:45 -0800
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-11-29 08:25:14 -0800
commit8e9cf9ecc6241f740edfa5bdc3533a2d0f2bb3e1 (patch)
tree04c765d805124563ea1fdb1c026b7d8cfda5682b /include
parent940a1f9f331d971562d6140bf5da58a9f5620376 (diff)
Return signal value if session loop is terminated by signal and improve documentation
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h13
-rw-r--r--include/fuse_common.h4
-rw-r--r--include/fuse_lowlevel.h28
3 files changed, 33 insertions, 12 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 56539f1..a9e569e 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -839,8 +839,12 @@ void fuse_destroy(struct fuse *f);
* Requests from the kernel are processed, and the appropriate
* operations are called.
*
+ * For a description of the return value and the conditions when the
+ * event loop exits, refer to the documentation of
+ * fuse_session_loop().
+ *
* @param f the FUSE handle
- * @return 0 if no error occurred, -errno otherwise
+ * @return see fuse_session_loop()
*
* See also: fuse_loop_mt()
*/
@@ -863,8 +867,9 @@ void fuse_exit(struct fuse *f);
* operations are called. Request are processed in parallel by
* distributing them between multiple threads.
*
- * Calling this function requires the pthreads library to be linked to
- * the application.
+ * For a description of the return value and the conditions when the
+ * event loop exits, refer to the documentation of
+ * fuse_session_loop().
*
* Note: using fuse_loop() instead of fuse_loop_mt() means you are running in
* single-threaded mode, and that you will not have to worry about reentrancy,
@@ -883,7 +888,7 @@ void fuse_exit(struct fuse *f);
* @param f the FUSE handle
* @param clone_fd whether to use separate device fds for each thread
* (may increase performance)
- * @return 0 if no error occurred, -errno otherwise
+ * @return see fuse_session_loop()
*
* See also: fuse_loop()
*/
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 27d3819..7c2e86f 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -692,8 +692,8 @@ ssize_t fuse_buf_copy(struct fuse_bufvec *dst, struct fuse_bufvec *src,
* Stores session in a global variable. May only be called once per
* process until fuse_remove_signal_handlers() is called.
*
- * Once either of the POSIX signals arrives, the fuse_session_exit()
- * is called.
+ * Once either of the POSIX signals arrives, the signal handler calls
+ * fuse_session_exit().
*
* @param se the session to exit
* @return 0 on success, -1 on failure
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 2cebb30..af3063f 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -1788,22 +1788,38 @@ int fuse_session_mount(struct fuse_session *se, const char *mountpoint);
/**
* Enter a single threaded, blocking event loop.
*
- * Using POSIX signals this event loop can be exited but the session
- * needs to be configued by issuing:
- * fuse_set_signal_handlers() first.
+ * When the event loop terminates because the connection to the FUSE
+ * kernel module has been closed, this function returns zero. This
+ * happens when the filesystem is unmounted regularly (by the
+ * filesystem owner or root running the umount(8) or fusermount(1)
+ * command), or if connection is explicitly severed by writing ``1``
+ * to the``abort`` file in ``/sys/fs/fuse/connections/NNN``. The only
+ * way to distinguish between these two conditions is to check if the
+ * filesystem is still mounted after the session loop returns.
+ *
+ * When some error occurs during request processing, the function
+ * returns a negated errno(3) value.
+ *
+ * If the loop has been terminated because of a signal handler
+ * installed by fuse_set_signal_handlers(), this function returns the
+ * (positive) signal value that triggered the exit.
*
* @param se the session
- * @return 0 on success, -errno on failure
+ * @return 0, -errno, or a signal value
*/
int fuse_session_loop(struct fuse_session *se);
/**
- * Enter a multi-threaded event loop
+ * Enter a multi-threaded event loop.
+ *
+ * For a description of the return value and the conditions when the
+ * event loop exits, refer to the documentation of
+ * fuse_session_loop().
*
* @param se the session
* @param clone_fd whether to use separate device fds for each thread
* (may increase performance)
- * @return 0 on success, -errno on failure
+ * @return see fuse_session_loop()
*/
int fuse_session_loop_mt(struct fuse_session *se, int clone_fd);