FUSE_LOOP(3) | Library Functions Manual | FUSE_LOOP(3)

# NAME

`fuse_loop`, `fuse_loop_mt` — wait for and process FUSE messages

# SYNOPSIS

library “libfuse”
`#include <fuse.h>`

int
`fuse_loop`(struct fuse *fuse);

int
`fuse_loop_mt`(struct fuse *fuse);

# DESCRIPTION

`fuse_loop`() reads from the FUSE device and blocks, waiting for the kernel to send it fbuf messages. Each of these specifies a FUSE file system operation to execute. The callbacks to invoke are specified by calling fuse_new(3) or fuse_setup(3) prior to calling `fuse_loop`().

`fuse_loop`() returns when it reads the `FBT_DESTROY` message, which indicates that the file system is being unmounted.

If FUSE signal handlers have been installed and `SIGHUP`, `SIGINT`, or `SIGTERM` is received, `fuse_loop`() terminates successfully. See fuse_set_signal_handlers(3) for more details.

`fuse_loop_mt`() is a multi-threaded variant that allows the file system to process multiple file system operations in parallel. This is not implemented on OpenBSD.

# RETURN VALUES

`fuse_loop`() returns 0 on success or -1 on failure.

`fuse_loop_mt`() always returns -1.

# SEE ALSO

fuse_main(3), fuse_set_signal_handlers(3), fb_queue(9)

# STANDARDS

The `fuse_loop`() and `fuse_loop_mt`() functions conform to FUSE 2.6.

# HISTORY

The `fuse_loop`() and `fuse_loop_mt`() functions first appeared in OpenBSD 5.4.

# AUTHORS

Sylvestre Gallon <ccna.syl@gmail.com>
Helg Bredow <helg@openbsd.org>

September 23, 2025 | Debian