FUSE_SESSION_LOOP(3)

NAME
fuse_session_loop, fuse_session_process, fuse_session_add_chan, fuse_session_remove_chan, fuse_session_exit, fuse_session_exited, fuse_session_reset - manage lifecycle and event handling for a FUSE session

SYNOPSIS
fuse
#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);

DESCRIPTION
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).

fuse_session_loop(se)
    Run the main event loop for the session se. This function blocks and processes incoming requests until fuse_session_exit() is called.

fuse_session_process(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.

fuse_session_add_chan(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.

fuse_session_remove_chan(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.

fuse_session_reset(se)
    Reset the session se to a non-exited state, allowing the loop to be restarted.

RETURN VALUES
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.

SEE ALSO
fuse_chan_fd(3), fuse_lowlevel_new(3), fuse_mount(3)

STANDARDS
These library functions conform to FUSE 2.6.

HISTORY
These functions have been available since OpenBSD 7.9.

AUTHORS
Helg Bredow <helg@openbsd.org>