FUSE_SESSION_LOOP(3) Library Functions Manual FUSE_SESSION_LOOP(3)

fuse_session_loop, fuse_session_process, fuse_session_add_chan, fuse_session_remove_chan, fuse_session_exit, fuse_session_exited, fuse_session_resetmanage lifecycle and event handling for a FUSE session

/* -lfuse */
#include <fuse_lowlevel.h>

int
fuse_session_loop(struct fuse_session *se);

void
fuse_session_process(struct fuse_session *se, struct fuse_chan *ch, const struct fuse_buf *buf, struct fuse_buf *outbuf);

void
fuse_session_add_chan(struct fuse_session *se, struct fuse_chan *ch);

void
fuse_session_remove_chan(struct fuse_chan *ch);

void
fuse_session_exit(struct fuse_session *se);

int
fuse_session_exited(struct fuse_session *se);

void
fuse_session_reset(struct fuse_session *se);

These functions are part of the FUSE low-level API and are used to manage the lifecycle, communication channel, and event processing of a FUSE session.

A fuse_session is created with fuse_lowlevel_new(3).

(se)
Run the main event loop for the session se. This function blocks and processes incoming requests until () is called.
(se, buf, bufsize, ch)
Process a single buffer buf received from channel ch in the session se. If ch is NULL then the channel added to the session is used instead. Used for manual request handling outside of the main loop.
(se, ch)
Add the communication channel ch to the session se. Channels are used to receive requests from the kernel. A session may be associated with only one channel at a time, and a channel may be associated with only one session at a time.
(ch)
Remove the channel ch from its associated session.
fuse_session_exit(se)
Signal the session se to exit its event loop. This does not destroy the session or unmount the filesystem.
(se)
Reset the session se to a non-exited state, allowing the loop to be restarted.

fuse_session_loop() returns 0 on success or -1 on failure.

fuse_session_exited() Returns non-zero if fuse_session_exit() has been called and the session se is marked for termination.

fuse_chan_fd(3), fuse_lowlevel_new(3), fuse_mount(3)

These library functions conform to FUSE 2.6.

These functions have been available since OpenBSD 7.9.

Helg Bredow <helg@openbsd.org>

OpenBSD 7.9 February 1, 2026 FUSE_SESSION_LOOP(3)