summaryrefslogtreecommitdiff
path: root/lib/libfuse/fuse_mount.3
blob: 5e8e928c3b8bd7e6544aff86fe8843352f417fca (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.\" $OpenBSD: fuse_mount.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_MOUNT 3
.Os
.Sh NAME
.Nm fuse_mount ,
.Nm fuse_unmount
.Nd mount or dismount a FUSE file system
.Sh SYNOPSIS
.In fuse.h
.Ft struct fuse_chan *
.Fn fuse_mount "const char *dir" "struct fuse_args *args"
.Ft void
.Fn fuse_unmount "const char *dir" "struct fuse_chan *ch"
.Sh DESCRIPTION
The
.Fn fuse_mount
function calls the
.Xr mount 2
system call to graft the FUSE file system on to the file system tree
at the point
.Fa dir .
.Fa args
are FUSE specific mount options as documented by
.Xr mount 2 .
.Pp
The following mount options can be specified by preceding them with
.Fl o ,
either individually or together separated by a comma.
.Bl -tag -width Ds
.It allow_other
Allow other users to access the file system.
By default, FUSE will prevent other users from accessing the file system or to
.Xr statfs 2
the file system.
This security measure is particularly important for
network file system that may expose private files.
It also guards against system processes being blocked indefinitely
if the file system stops responding.
.It default_permissions
Request that the kernel enforce file access permissions.
Alternatively, FUSE file systems can choose to implement access
checks internally.
On
.Ox ,
this option is always set.
.It kernel_cache
Enables buffering of files in the kernel.
Not recommended for file systems that can be updated external to FUSE,
such as network file systems.
Not implemented.
.It max_read=%u
Specify the maximum size of read operations.
Note that the kernel limits this to FUSEBUFMAXSIZE.
This option should not be specified on the command line.
The correct (or optimum) value depends on the filesystem implementation
and should thus be specified by the filesystem internally.
.It ro
Mount the file system read-only.
Can also be specified by itself with
.Fl r .
.El
.Pp
.Fn fuse_unmount
will attempt to unmount the file system mounted at
.Fa dir
by calling the
.Xr unmount 2
system call.
If this is successful, the kernel will send the
FBT_DESTROY message to the file system, causing
.Xr fuse_loop 3
to terminate.
There is no way to determine whether this call was successful.
.Pp
Only the super user can mount and unmount FUSE file systems.
.Sh RETURN VALUES
.Fn fuse_main
will return NULL if the file system cannot be mounted.
.Sh ERRORS
.Fn fuse_mount
will fail when one of the following occurs:
.Fa dir
does not exist or is not a directory.
The fuse device cannot be opened for reading and writing.
There was an error parsing the options specified by
.Fa args .
The file system could not be mounted.
.Sh SEE ALSO
.Xr mount 2 ,
.Xr fuse_main 3 ,
.Xr fuse_setup 3 ,
.Xr fuse 4
.Sh STANDARDS
The
.Fn fuse_mount
and
.Fn fuse_unmount
functions conforms to FUSE 2.6.
.Sh HISTORY
The
.Fn fuse_mount
and
.Fn fuse_unmount
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