xref: /openbsd/lib/libfuse/fuse_loop.3 (revision e5dd7070)
1.\" $OpenBSD: fuse_loop.3,v 1.2 2018/07/08 06:17:10 jmc 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: July 8 2018 $
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.In fuse.h
26.Ft int
27.Fn fuse_loop "struct fuse *fuse"
28.Ft int
29.Fn fuse_loop_mt "struct fuse *fuse"
30.Sh DESCRIPTION
31.Fn fuse_loop
32reads from the FUSE device and blocks, waiting for the
33kernel to send it fbuf messages.
34Each of these specifies a FUSE file system operation to execute.
35The callbacks to invoke are specified by calling
36.Xr fuse_new 3
37or
38.Xr fuse_setup 3
39prior to calling
40.Fn fuse_loop .
41.Pp
42.Fn fuse_loop
43will return when it reads the FBT_DESTROY message, which indicates that
44the file system is being unmounted.
45.Pp
46If FUSE signaler handlers have been installed and either SIGHUP, SIGINT
47or SIGTERM is received then
48.Fn fuse_loop
49will attempt to unmount the file system.
50See
51.Xr fuse_set_signal_handlers 3 .
52.Pp
53.Fn fuse_loop_mt
54is a multi-threaded variant that allows the file system to process
55multiple file system operations in parallel.
56This is not implemented on
57.Ox .
58.Sh RETURN VALUES
59.Fn fuse_loop
60will return 0 on success and -1 on failure.
61.Pp
62.Fn fuse_loop_mt
63always returns -1.
64.Sh SEE ALSO
65.Xr fuse_main 3 ,
66.Xr fuse_set_signal_handlers 3 ,
67.Xr fb_queue 9
68.Sh STANDARDS
69The
70.Fn fuse_loop
71and
72.Fn fuse_loop_mt
73functions conform to FUSE 2.6.
74.Sh HISTORY
75The
76.Fn fuse_loop
77and
78.Fn fuse_loop_mt
79functions first appeared in
80.Ox 5.4 .
81.Sh AUTHORS
82.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
83.An Helg Bredow Aq Mt helg@openbsd.org
84