xref: /openbsd-src/lib/libfuse/fuse_setup.3 (revision 44787df46ac98ea875d0053422ababbe894b59fc)
1*44787df4Smpi.\" $OpenBSD: fuse_setup.3,v 1.3 2018/11/28 21:19:11 mpi Exp $
28e7147f2Shelg.\"
38e7147f2Shelg.\" Copyright (c) 2018 Helg Bredow <helg.bredow@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.\"
17*44787df4Smpi.Dd $Mdocdate: November 28 2018 $
188e7147f2Shelg.Dt FUSE_SETUP 3
198e7147f2Shelg.Os
208e7147f2Shelg.Sh NAME
218e7147f2Shelg.Nm fuse_setup
228e7147f2Shelg.Nd FUSE helper function
238e7147f2Shelg.Sh SYNOPSIS
248e7147f2Shelg.In fuse.h
258e7147f2Shelg.Ft struct fuse *
268e7147f2Shelg.Fn fuse_setup "int argc" "char **argv" \
278e7147f2Shelg    "const struct fuse_operations *ops" "size_t size" "char **mp" \
288e7147f2Shelg    "int *mt" "void *data"
298e7147f2Shelg.Sh DESCRIPTION
308e7147f2Shelg.Fn fuse_setup
318e7147f2Shelgis a helper function that mounts a FUSE file system, creates a new FUSE
328e7147f2Shelgsession and installs signal handlers that will try to unmount the file
338e7147f2Shelgsystem on SIGINT, SIGTERM or SIGHUP.
348e7147f2Shelg.Pp
358e7147f2Shelg.Fn fuse_setup
36477ebe4aSjmcwill parse the arguments specified by argv and if neither the
37477ebe4aSjmc.Fl f , Fl d
38477ebe4aSjmcor
39477ebe4aSjmc.Fl odebug
40477ebe4aSjmcoptions were specified, detach from the controlling terminal
418e7147f2Shelgand run in the background.
428e7147f2ShelgOn success,
438e7147f2Shelg.Fa mt
448e7147f2Shelgwill be 1 if the file system operations will be invoked in
458e7147f2Shelgparallel (multi-threaded) or 0 if file system operations are serialized.
46477ebe4aSjmcFile systems that do not support multi-threaded operation must include the
47477ebe4aSjmc.Fl s
48477ebe4aSjmcargument in
498e7147f2Shelg.Fa argv .
508e7147f2Shelg.Ox
518e7147f2Shelgdoes not currently support multi-threaded operation.
528e7147f2Shelg.Pp
538e7147f2ShelgThe file system will be mounted on
548e7147f2Shelg.Fa mp ,
558e7147f2Shelgwhich is the directory specified by the first
568e7147f2Shelgargument that does not match one of the options recognised by
57*44787df4Smpi.Xr fuse_parse_cmdline 3 .
588e7147f2Shelg.Pp
598e7147f2Shelg.Fa fuse_operations
608e7147f2Shelgis a struct of size
618e7147f2Shelg.Fa size
62477ebe4aSjmcthat contains pointers to FUSE file system operations.
63477ebe4aSjmcSee
648e7147f2Shelg.Xr fuse_new 3 .
658e7147f2Shelg.Sh RETURN VALUES
668e7147f2Shelg.Fn fuse_setup
678e7147f2Shelgwill return NULL on failure.
688e7147f2Shelg.Sh SEE ALSO
698e7147f2Shelg.Xr fuse_main 3 ,
708e7147f2Shelg.Xr fuse_mount 3  ,
718e7147f2Shelg.Xr fuse_new 3 ,
72*44787df4Smpi.Xr fuse_parse_cmdline 3 ,
738e7147f2Shelg.Xr fuse_set_signal_handlers 3 ,
748e7147f2Shelg.Xr fuse_teardown 3 ,
758e7147f2Shelg.Xr fuse 4
768e7147f2Shelg.Sh STANDARDS
778e7147f2ShelgThe
78477ebe4aSjmc.Fn fuse_setup
798e7147f2Shelgfunction conforms to FUSE 2.6.
808e7147f2Shelg.Sh HISTORY
818e7147f2ShelgThe
828e7147f2Shelg.Fn fuse_setup
838e7147f2Shelgfunction first appeared in
848e7147f2Shelg.Ox 5.4 .
858e7147f2Shelg.Sh AUTHORS
868e7147f2Shelg.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
878e7147f2Shelg.An Helg Bredow Aq Mt helg@openbsd.org
88