From: Bernd Schubert One might want to print debug out in background mode, which the command line parameter does not easily allow. Or one might want to enable and disable at run time. Signed-off-by: Bernd Schubert Reviewed-by: "Darrick J. Wong" --- include/fuse_lowlevel.h | 12 ++++++++++++ lib/fuse_lowlevel.c | 5 +++++ lib/fuse_versionscript | 1 + 3 files changed, 18 insertions(+) diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index d8626f85bdaf497534cd2835a589e30f1f4e2466..d85929e291a77de8caad7d6b3d9ac5b092ce0e62 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -2441,6 +2441,18 @@ int fuse_session_receive_buf(struct fuse_session *se, struct fuse_buf *buf); */ void fuse_session_want_sync_init(struct fuse_session *se); +/** + * Enable debug output + * + * This allows to enable debug output without a command line parameter and + * without the enforcement of the command line parameter to run in foreground. + * The daemon needs to handle either fuse_log output via stderr, or + * redirection to its own logs or via syslog. + * + * @param se the session + */ +void fuse_session_set_debug(struct fuse_session *se); + /** * Check if the request is submitted through fuse-io-uring */ diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 0dd10e0ed53508e4716703f2f82aa35ad853b247..4445e134a7ff5be508306f74db9d9c56e3582070 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -5010,3 +5010,8 @@ void fuse_session_want_sync_init(struct fuse_session *se) return; se->want_sync_init = true; } + +void fuse_session_set_debug(struct fuse_session *se) +{ + se->debug = 1; +} diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index dc6ed0135fb8d82937c756c3fb04a7fcb48fe1f4..3e1ea641a8be58ae9f68319873d3db4cbb902d3b 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -231,6 +231,7 @@ FUSE_3.19 { fuse_daemonize_success; fuse_daemonize_fail; fuse_daemonize_is_active; + fuse_session_set_debug; } FUSE_3.18; # Local Variables: -- 2.43.0