summaryrefslogtreecommitdiff
path: root/lib/libfuse/fuse_loop.3
blob: e86b5067a6a7374c80f91b4e6534861f3e5782bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.\" $OpenBSD: fuse_loop.3,v 1.2 2018/07/08 06:17:10 jmc Exp $
.\"
.\" Copyright (c) 2018 Helg Bredow <helg@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: July 8 2018 $
.Dt FUSE_LOOP 3
.Os
.Sh NAME
.Nm fuse_loop ,
.Nm fuse_loop_mt
.Nd wait for and process FUSE messages
.Sh SYNOPSIS
.In fuse.h
.Ft int
.Fn fuse_loop "struct fuse *fuse"
.Ft int
.Fn fuse_loop_mt "struct fuse *fuse"
.Sh DESCRIPTION
.Fn 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
.Xr fuse_new 3
or
.Xr fuse_setup 3
prior to calling
.Fn fuse_loop .
.Pp
.Fn fuse_loop
will return when it reads the FBT_DESTROY message, which indicates that
the file system is being unmounted.
.Pp
If FUSE signaler handlers have been installed and either SIGHUP, SIGINT
or SIGTERM is received then
.Fn fuse_loop
will attempt to unmount the file system.
See
.Xr fuse_set_signal_handlers 3 .
.Pp
.Fn 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
.Ox .
.Sh RETURN VALUES
.Fn fuse_loop
will return 0 on success and -1 on failure.
.Pp
.Fn fuse_loop_mt
always returns -1.
.Sh SEE ALSO
.Xr fuse_main 3 ,
.Xr fuse_set_signal_handlers 3 ,
.Xr fb_queue 9
.Sh STANDARDS
The
.Fn fuse_loop
and
.Fn fuse_loop_mt
functions conform to FUSE 2.6.
.Sh HISTORY
The
.Fn fuse_loop
and
.Fn fuse_loop_mt
functions first appeared in
.Ox 5.4 .
.Sh AUTHORS
.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
.An Helg Bredow Aq Mt helg@openbsd.org