xref: /openbsd/lib/libfuse/fuse_setup.3 (revision d415bd75)
1.\" $OpenBSD: fuse_setup.3,v 1.3 2018/11/28 21:19:11 mpi Exp $
2.\"
3.\" Copyright (c) 2018 Helg Bredow <helg.bredow@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: November 28 2018 $
18.Dt FUSE_SETUP 3
19.Os
20.Sh NAME
21.Nm fuse_setup
22.Nd FUSE helper function
23.Sh SYNOPSIS
24.In fuse.h
25.Ft struct fuse *
26.Fn fuse_setup "int argc" "char **argv" \
27    "const struct fuse_operations *ops" "size_t size" "char **mp" \
28    "int *mt" "void *data"
29.Sh DESCRIPTION
30.Fn fuse_setup
31is a helper function that mounts a FUSE file system, creates a new FUSE
32session and installs signal handlers that will try to unmount the file
33system on SIGINT, SIGTERM or SIGHUP.
34.Pp
35.Fn fuse_setup
36will parse the arguments specified by argv and if neither the
37.Fl f , Fl d
38or
39.Fl odebug
40options were specified, detach from the controlling terminal
41and run in the background.
42On success,
43.Fa mt
44will be 1 if the file system operations will be invoked in
45parallel (multi-threaded) or 0 if file system operations are serialized.
46File systems that do not support multi-threaded operation must include the
47.Fl s
48argument in
49.Fa argv .
50.Ox
51does not currently support multi-threaded operation.
52.Pp
53The file system will be mounted on
54.Fa mp ,
55which is the directory specified by the first
56argument that does not match one of the options recognised by
57.Xr fuse_parse_cmdline 3 .
58.Pp
59.Fa fuse_operations
60is a struct of size
61.Fa size
62that contains pointers to FUSE file system operations.
63See
64.Xr fuse_new 3 .
65.Sh RETURN VALUES
66.Fn fuse_setup
67will return NULL on failure.
68.Sh SEE ALSO
69.Xr fuse_main 3 ,
70.Xr fuse_mount 3  ,
71.Xr fuse_new 3 ,
72.Xr fuse_parse_cmdline 3 ,
73.Xr fuse_set_signal_handlers 3 ,
74.Xr fuse_teardown 3 ,
75.Xr fuse 4
76.Sh STANDARDS
77The
78.Fn fuse_setup
79function conforms to FUSE 2.6.
80.Sh HISTORY
81The
82.Fn fuse_setup
83function first appeared in
84.Ox 5.4 .
85.Sh AUTHORS
86.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com
87.An Helg Bredow Aq Mt helg@openbsd.org
88