jcs's openbsd hax
openbsd
1.\" $OpenBSD: fuse_loop.3,v 1.5 2025/09/23 09:28:28 schwarze Exp $
2.\"
3.\" Copyright (c) 2018 Helg Bredow <helg@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: September 23 2025 $
18.Dt FUSE_LOOP 3
19.Os
20.Sh NAME
21.Nm fuse_loop ,
22.Nm fuse_loop_mt
23.Nd wait for and process FUSE messages
24.Sh SYNOPSIS
25.Lb libfuse
26.In fuse.h
27.Ft int
28.Fn fuse_loop "struct fuse *fuse"
29.Ft int
30.Fn fuse_loop_mt "struct fuse *fuse"
31.Sh DESCRIPTION
32.Fn fuse_loop
33reads from the FUSE device and blocks, waiting for the
34kernel to send it fbuf messages.
35Each of these specifies a FUSE file system operation to execute.
36The callbacks to invoke are specified by calling
37.Xr fuse_new 3
38or
39.Xr fuse_setup 3
40prior to calling
41.Fn fuse_loop .
42.Pp
43.Fn fuse_loop
44returns when it reads the
45.Dv FBT_DESTROY
46message, which indicates that
47the file system is being unmounted.
48.Pp
49If FUSE signal handlers have been installed and
50.Dv SIGHUP ,
51.Dv SIGINT ,
52or
53.Dv SIGTERM
54is received,
55.Fn fuse_loop
56terminates successfully.
57See
58.Xr fuse_set_signal_handlers 3
59for more details.
60.Pp
61.Fn fuse_loop_mt
62is a multi-threaded variant that allows the file system to process
63multiple file system operations in parallel.
64This is not implemented on
65.Ox .
66.Sh RETURN VALUES
67.Fn fuse_loop
68returns 0 on success or -1 on failure.
69.Pp
70.Fn fuse_loop_mt
71always returns -1.
72.Sh SEE ALSO
73.Xr fuse_main 3 ,
74.Xr fuse_set_signal_handlers 3 ,
75.Xr fb_queue 9
76.Sh STANDARDS
77The
78.Fn fuse_loop
79and
80.Fn fuse_loop_mt
81functions conform to FUSE 2.6.
82.Sh HISTORY
83The
84.Fn fuse_loop
85and
86.Fn fuse_loop_mt
87functions first appeared in
88.Ox 5.4 .
89.Sh AUTHORS
90.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
91.An Helg Bredow Aq Mt helg@openbsd.org