xref: /openbsd-src/lib/libfuse/fuse_loop.3 (revision 477ebe4a3e1592cae39f939a2031cd19479550c5)
1*477ebe4aSjmc.\" $OpenBSD: fuse_loop.3,v 1.2 2018/07/08 06:17:10 jmc Exp $
28e7147f2Shelg.\"
38e7147f2Shelg.\" Copyright (c) 2018 Helg Bredow <helg@openbsd.org>
48e7147f2Shelg.\"
58e7147f2Shelg.\" Permission to use, copy, modify, and distribute this software for any
68e7147f2Shelg.\" purpose with or without fee is hereby granted, provided that the above
78e7147f2Shelg.\" copyright notice and this permission notice appear in all copies.
88e7147f2Shelg.\"
98e7147f2Shelg.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
108e7147f2Shelg.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
118e7147f2Shelg.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
128e7147f2Shelg.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
138e7147f2Shelg.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
148e7147f2Shelg.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
158e7147f2Shelg.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
168e7147f2Shelg.\"
178e7147f2Shelg.Dd $Mdocdate: July 8 2018 $
188e7147f2Shelg.Dt FUSE_LOOP 3
198e7147f2Shelg.Os
208e7147f2Shelg.Sh NAME
218e7147f2Shelg.Nm fuse_loop ,
228e7147f2Shelg.Nm fuse_loop_mt
23*477ebe4aSjmc.Nd wait for and process FUSE messages
248e7147f2Shelg.Sh SYNOPSIS
258e7147f2Shelg.In fuse.h
268e7147f2Shelg.Ft int
278e7147f2Shelg.Fn fuse_loop "struct fuse *fuse"
288e7147f2Shelg.Ft int
298e7147f2Shelg.Fn fuse_loop_mt "struct fuse *fuse"
308e7147f2Shelg.Sh DESCRIPTION
318e7147f2Shelg.Fn fuse_loop
328e7147f2Shelgreads from the FUSE device and blocks, waiting for the
33*477ebe4aSjmckernel to send it fbuf messages.
34*477ebe4aSjmcEach of these specifies a FUSE file system operation to execute.
35*477ebe4aSjmcThe callbacks to invoke are specified by calling
368e7147f2Shelg.Xr fuse_new 3
378e7147f2Shelgor
388e7147f2Shelg.Xr fuse_setup 3
398e7147f2Shelgprior to calling
408e7147f2Shelg.Fn fuse_loop .
418e7147f2Shelg.Pp
428e7147f2Shelg.Fn fuse_loop
438e7147f2Shelgwill return when it reads the FBT_DESTROY message, which indicates that
448e7147f2Shelgthe file system is being unmounted.
458e7147f2Shelg.Pp
468e7147f2ShelgIf FUSE signaler handlers have been installed and either SIGHUP, SIGINT
478e7147f2Shelgor SIGTERM is received then
488e7147f2Shelg.Fn fuse_loop
49*477ebe4aSjmcwill attempt to unmount the file system.
50*477ebe4aSjmcSee
518e7147f2Shelg.Xr fuse_set_signal_handlers 3 .
528e7147f2Shelg.Pp
538e7147f2Shelg.Fn fuse_loop_mt
54*477ebe4aSjmcis a multi-threaded variant that allows the file system to process
55*477ebe4aSjmcmultiple file system operations in parallel.
56*477ebe4aSjmcThis is not implemented on
57*477ebe4aSjmc.Ox .
588e7147f2Shelg.Sh RETURN VALUES
598e7147f2Shelg.Fn fuse_loop
608e7147f2Shelgwill return 0 on success and -1 on failure.
618e7147f2Shelg.Pp
628e7147f2Shelg.Fn fuse_loop_mt
638e7147f2Shelgalways returns -1.
648e7147f2Shelg.Sh SEE ALSO
658e7147f2Shelg.Xr fuse_main 3 ,
66*477ebe4aSjmc.Xr fuse_set_signal_handlers 3 ,
67*477ebe4aSjmc.Xr fb_queue 9
688e7147f2Shelg.Sh STANDARDS
698e7147f2ShelgThe
708e7147f2Shelg.Fn fuse_loop
718e7147f2Shelgand
728e7147f2Shelg.Fn fuse_loop_mt
738e7147f2Shelgfunctions conform to FUSE 2.6.
748e7147f2Shelg.Sh HISTORY
758e7147f2ShelgThe
768e7147f2Shelg.Fn fuse_loop
778e7147f2Shelgand
788e7147f2Shelg.Fn fuse_loop_mt
798e7147f2Shelgfunctions first appeared in
808e7147f2Shelg.Ox 5.4 .
818e7147f2Shelg.Sh AUTHORS
828e7147f2Shelg.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
838e7147f2Shelg.An Helg Bredow Aq Mt helg@openbsd.org
84