| @@ -1,321 +1,321 @@ | | | @@ -1,321 +1,321 @@ |
1 | .\" $NetBSD: ukfs.3,v 1.15 2018/02/08 09:05:17 dholland Exp $ | | 1 | .\" $NetBSD: ukfs.3,v 1.16 2018/03/12 11:56:34 pgoyette Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2008 Antti Kantee. All rights reserved. | | 3 | .\" Copyright (c) 2008 Antti Kantee. All rights reserved. |
4 | .\" | | 4 | .\" |
5 | .\" Redistribution and use in source and binary forms, with or without | | 5 | .\" Redistribution and use in source and binary forms, with or without |
6 | .\" modification, are permitted provided that the following conditions | | 6 | .\" modification, are permitted provided that the following conditions |
7 | .\" are met: | | 7 | .\" are met: |
8 | .\" 1. Redistributions of source code must retain the above copyright | | 8 | .\" 1. Redistributions of source code must retain the above copyright |
9 | .\" notice, this list of conditions and the following disclaimer. | | 9 | .\" notice, this list of conditions and the following disclaimer. |
10 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 10 | .\" 2. Redistributions in binary form must reproduce the above copyright |
11 | .\" notice, this list of conditions and the following disclaimer in the | | 11 | .\" notice, this list of conditions and the following disclaimer in the |
12 | .\" documentation and/or other materials provided with the distribution. | | 12 | .\" documentation and/or other materials provided with the distribution. |
13 | .\" | | 13 | .\" |
14 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | | 14 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
15 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 15 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 16 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
17 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 17 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
18 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 18 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
19 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 19 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 20 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
21 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 21 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
22 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 22 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
23 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 23 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
24 | .\" SUCH DAMAGE. | | 24 | .\" SUCH DAMAGE. |
25 | .\" | | 25 | .\" |
26 | .Dd February 13, 2014 | | 26 | .Dd March 12, 2018 |
27 | .Dt UKFS 3 | | 27 | .Dt UKFS 3 |
28 | .Os | | 28 | .Os |
29 | .Sh NAME | | 29 | .Sh NAME |
30 | .Nm ukfs | | 30 | .Nm ukfs |
31 | .Nd user kernel file system library interface | | 31 | .Nd user kernel file system library interface |
32 | .Sh LIBRARY | | 32 | .Sh LIBRARY |
33 | ukfs Library (libukfs, \-lukfs) | | 33 | ukfs Library (libukfs, \-lukfs) |
34 | .Sh SYNOPSIS | | 34 | .Sh SYNOPSIS |
35 | .In rump/ukfs.h | | 35 | .In rump/ukfs.h |
36 | .Sh DESCRIPTION | | 36 | .Sh DESCRIPTION |
37 | The | | 37 | The |
38 | .Nm | | 38 | .Nm |
39 | library provides direct access to file systems without having to | | 39 | library provides direct access to file systems without having to |
40 | specially mount a file system. | | 40 | specially mount a file system. |
41 | Therefore, accessing a file system through | | 41 | Therefore, accessing a file system through |
42 | .Nm | | 42 | .Nm |
43 | requires no special kernel support apart from standard POSIX functionality. | | 43 | requires no special kernel support apart from standard POSIX functionality. |
44 | As | | 44 | As |
45 | .Nm | | 45 | .Nm |
46 | is built upon | | 46 | is built upon |
47 | .Xr rump 3 | | 47 | .Xr rump 3 |
48 | kernels, all kernel file systems which are supported by rump kernels | | 48 | kernels, all kernel file systems which are supported by rump kernels |
49 | are available. | | 49 | are available. |
50 | It allows to write utilities for accessing file systems | | 50 | It allows to write utilities for accessing file systems |
51 | without having to duplicate file system internals knowledge already | | 51 | without having to duplicate file system internals knowledge already |
52 | present in kernel file system drivers. | | 52 | present in kernel file system drivers. |
53 | .Pp | | 53 | .Pp |
54 | .Nm | | 54 | .Nm |
55 | provides a high-level pathname based interface for accessing file systems. | | 55 | provides a high-level pathname based interface for accessing file systems. |
56 | If a lower level interface it desired, | | 56 | If a lower level interface it desired, |
57 | .Xr rump 3 | | 57 | .Xr rump 3 |
58 | kernels should be used directly. | | 58 | kernels should be used directly. |
59 | However, much like system calls, the interfaces of | | 59 | However, much like system calls, the interfaces of |
60 | .Nm , | | 60 | .Nm |
61 | are self-contained and require no tracking and release of resources. | | 61 | are self-contained and require no tracking and release of resources. |
62 | The only exception is the file system handle | | 62 | The only exception is the file system handle |
63 | .Ft struct ukfs | | 63 | .Ft struct ukfs |
64 | which should be released after use. | | 64 | which should be released after use. |
65 | .Sh INITIALIZATION | | 65 | .Sh INITIALIZATION |
66 | .Bl -ohang | | 66 | .Bl -ohang |
67 | .It Ft int | | 67 | .It Ft int |
68 | .Fn ukfs_init | | 68 | .Fn ukfs_init |
69 | .It Ft int | | 69 | .It Ft int |
70 | .Fn ukfs_modload "const char *fname" | | 70 | .Fn ukfs_modload "const char *fname" |
71 | .It Ft int | | 71 | .It Ft int |
72 | .Fn ukfs_modload_dir "const char *dirname" | | 72 | .Fn ukfs_modload_dir "const char *dirname" |
73 | .It Ft ssize_t | | 73 | .It Ft ssize_t |
74 | .Fn ukfs_vfstypes "char *buf" "size_t buflen" | | 74 | .Fn ukfs_vfstypes "char *buf" "size_t buflen" |
75 | .It Ft struct ukfs * | | 75 | .It Ft struct ukfs * |
76 | .Fn ukfs_mount "const char *vfsname" "const char *devpath" \ | | 76 | .Fn ukfs_mount "const char *vfsname" "const char *devpath" \ |
77 | "const char *mountpath" "int mntflags" "void *arg" "size_t alen" | | 77 | "const char *mountpath" "int mntflags" "void *arg" "size_t alen" |
78 | .It Ft struct ukfs * | | 78 | .It Ft struct ukfs * |
79 | .Fn ukfs_mount_disk "const char *vfsname" "const char *devpath" \ | | 79 | .Fn ukfs_mount_disk "const char *vfsname" "const char *devpath" \ |
80 | "int partition" "const char *mountpath" "int mntflags" \ | | 80 | "int partition" "const char *mountpath" "int mntflags" \ |
81 | "void *arg" "size_t alen" | | 81 | "void *arg" "size_t alen" |
82 | .It Ft int | | 82 | .It Ft int |
83 | .Fn ukfs_release "struct ukfs *ukfs" "int flags" | | 83 | .Fn ukfs_release "struct ukfs *ukfs" "int flags" |
84 | .El | | 84 | .El |
85 | .Pp | | 85 | .Pp |
86 | .Fn ukfs_init | | 86 | .Fn ukfs_init |
87 | initializes the library and must be called once per process using | | 87 | initializes the library and must be called once per process using |
88 | .Nm . | | 88 | .Nm . |
89 | .Pp | | 89 | .Pp |
90 | .Fn ukfs_modload | | 90 | .Fn ukfs_modload |
91 | is used at runtime to dynamically load a library which contains a | | 91 | is used at runtime to dynamically load a library which contains a |
92 | file system module. | | 92 | file system module. |
93 | For this to succeed, the | | 93 | For this to succeed, the |
94 | .Xr rump 3 | | 94 | .Xr rump 3 |
95 | kernel and the module targetted must be compiled with compatible kernel | | 95 | kernel and the module targetted must be compiled with compatible kernel |
96 | versions and the application must be dynamically linked. | | 96 | versions and the application must be dynamically linked. |
97 | Additionally, since this routine does not handle dependencies, all the | | 97 | Additionally, since this routine does not handle dependencies, all the |
98 | dependencies of the library must be loaded beforehand. | | 98 | dependencies of the library must be loaded beforehand. |
99 | The routine returns \-1 for fatal error, 0 for dependency failure and 1 | | 99 | The routine returns \-1 for fatal error, 0 for dependency failure and 1 |
100 | for success. | | 100 | for success. |
101 | .Pp | | 101 | .Pp |
102 | .Fn ukfs_modload_dir | | 102 | .Fn ukfs_modload_dir |
103 | loads all | | 103 | loads all |
104 | .Xr rump 3 | | 104 | .Xr rump 3 |
105 | kernel file system components in directory | | 105 | kernel file system components in directory |
106 | .Fa dirname . | | 106 | .Fa dirname . |
107 | It looks for libraries which begin with | | 107 | It looks for libraries which begin with |
108 | .Pa librumpfs_ | | 108 | .Pa librumpfs_ |
109 | and end in | | 109 | and end in |
110 | .Pa .so . | | 110 | .Pa .so . |
111 | The routine tries to handle dependencies by retrying to load libraries | | 111 | The routine tries to handle dependencies by retrying to load libraries |
112 | which failed due to dependencies. | | 112 | which failed due to dependencies. |
113 | .Fn ukfs_modload_dir | | 113 | .Fn ukfs_modload_dir |
114 | returns the number of vfs modules loaded or sets errno and | | 114 | returns the number of vfs modules loaded or sets errno and |
115 | returns \-1 in case of a fatal error in directory searching. | | 115 | returns \-1 in case of a fatal error in directory searching. |
116 | In case a fatal error occurs after some modules have already been | | 116 | In case a fatal error occurs after some modules have already been |
117 | loaded, the number of loaded module is returned. | | 117 | loaded, the number of loaded module is returned. |
118 | Fatal errors in loading the modules themselves are ignored and | | 118 | Fatal errors in loading the modules themselves are ignored and |
119 | .Fn ukfs_modload | | 119 | .Fn ukfs_modload |
120 | should be used directly if finegrained error reporting is desired. | | 120 | should be used directly if finegrained error reporting is desired. |
121 | .Pp | | 121 | .Pp |
122 | It should be noted that the above routines affect the whole process, | | 122 | It should be noted that the above routines affect the whole process, |
123 | not just a specific instance of | | 123 | not just a specific instance of |
124 | .Nm . | | 124 | .Nm . |
125 | It is preferable to call them from only one thread, as the underlying | | 125 | It is preferable to call them from only one thread, as the underlying |
126 | dynamic library interfaces may not be threadsafe. | | 126 | dynamic library interfaces may not be threadsafe. |
127 | .Pp | | 127 | .Pp |
128 | .Fn ukfs_vfstypes | | 128 | .Fn ukfs_vfstypes |
129 | queries the available file system types and returns a nul-terminated | | 129 | queries the available file system types and returns a nul-terminated |
130 | list of types separated by spaces in | | 130 | list of types separated by spaces in |
131 | .Fa buf . | | 131 | .Fa buf . |
132 | The format of the list is equivalent to the one returned by | | 132 | The format of the list is equivalent to the one returned by |
133 | .Xr sysctl 3 | | 133 | .Xr sysctl 3 |
134 | on the name | | 134 | on the name |
135 | .Pa vfs.generic.fstypes . | | 135 | .Pa vfs.generic.fstypes . |
136 | The function returns the length of the string without the trailing nul | | 136 | The function returns the length of the string without the trailing nul |
137 | or \-1 for error. | | 137 | or \-1 for error. |
138 | Notably, the return value 0 means there are no file systems available. | | 138 | Notably, the return value 0 means there are no file systems available. |
139 | If there is not enough room in the caller's buffer for all file system | | 139 | If there is not enough room in the caller's buffer for all file system |
140 | types, as many as fit will be returned. | | 140 | types, as many as fit will be returned. |
141 | .Pp | | 141 | .Pp |
142 | .Fn ukfs_mount | | 142 | .Fn ukfs_mount |
143 | initializes a file system image. | | 143 | initializes a file system image. |
144 | The handle resulting from the operation is passed to all other routines | | 144 | The handle resulting from the operation is passed to all other routines |
145 | and identifies the instance of the mount analoguous to what a pathname | | 145 | and identifies the instance of the mount analoguous to what a pathname |
146 | specifies in a normally mounted file system. | | 146 | specifies in a normally mounted file system. |
147 | The parameters are the following: | | 147 | The parameters are the following: |
148 | .Bl -tag -width XXX -offset indent | | 148 | .Bl -tag -width XXX -offset indent |
149 | .It vfsname | | 149 | .It vfsname |
150 | Name of the file system to be used, e.g. | | 150 | Name of the file system to be used, e.g. |
151 | .Dv MOUNT_FFS . | | 151 | .Dv MOUNT_FFS . |
152 | .It devpath | | 152 | .It devpath |
153 | Path of file system image. | | 153 | Path of file system image. |
154 | It can be either a regular file, device or, if the file system does | | 154 | It can be either a regular file, device or, if the file system does |
155 | not support the concept of a device, an abitrary string, e.g. network | | 155 | not support the concept of a device, an abitrary string, e.g. network |
156 | address. | | 156 | address. |
157 | .It mountpath | | 157 | .It mountpath |
158 | Path where the file system is mounted to. | | 158 | Path where the file system is mounted to. |
159 | This parameter is used only by the file system being mounted. | | 159 | This parameter is used only by the file system being mounted. |
160 | Most of the time | | 160 | Most of the time |
161 | .Dv UKFS_DEFAULTMP | | 161 | .Dv UKFS_DEFAULTMP |
162 | is the correct path. | | 162 | is the correct path. |
163 | .It mntflags | | 163 | .It mntflags |
164 | Flags as passed to the | | 164 | Flags as passed to the |
165 | .Xr mount 2 | | 165 | .Xr mount 2 |
166 | system call, for example | | 166 | system call, for example |
167 | .Dv MNT_RDONLY . | | 167 | .Dv MNT_RDONLY . |
168 | In addition to generic parameters, file system specific parameters such as | | 168 | In addition to generic parameters, file system specific parameters such as |
169 | .Dv MNT_LOG | | 169 | .Dv MNT_LOG |
170 | (ffs) may be passed here. | | 170 | (ffs) may be passed here. |
171 | .It arg | | 171 | .It arg |
172 | File system private argument structure. | | 172 | File system private argument structure. |
173 | This is passed directly to the file system. | | 173 | This is passed directly to the file system. |
174 | It must match what | | 174 | It must match what |
175 | .Fa vfsname | | 175 | .Fa vfsname |
176 | expects. | | 176 | expects. |
177 | .It alen | | 177 | .It alen |
178 | Size of said structure. | | 178 | Size of said structure. |
179 | .El | | 179 | .El |
180 | .Pp | | 180 | .Pp |
181 | The | | 181 | The |
182 | .Fn ukfs_mount_disk | | 182 | .Fn ukfs_mount_disk |
183 | function must be used to mount disk-based file systems. | | 183 | function must be used to mount disk-based file systems. |
184 | It takes the same arguments as | | 184 | It takes the same arguments as |
185 | .Fn ukfs_mount , | | 185 | .Fn ukfs_mount , |
186 | except for an additional argument signifying the | | 186 | except for an additional argument signifying the |
187 | .Fa partition | | 187 | .Fa partition |
188 | number. | | 188 | number. |
189 | If the image | | 189 | If the image |
190 | .Fa devpath | | 190 | .Fa devpath |
191 | contains a disklabel, this value specifies the number of the partition | | 191 | contains a disklabel, this value specifies the number of the partition |
192 | within the image used as the file system backend. | | 192 | within the image used as the file system backend. |
193 | If | | 193 | If |
194 | .Fa devpath | | 194 | .Fa devpath |
195 | does not contain a disklabel, the value | | 195 | does not contain a disklabel, the value |
196 | .Dv UKFS_PARTITION_NONE | | 196 | .Dv UKFS_PARTITION_NONE |
197 | must be used to signal that the file system backend is the entire | | 197 | must be used to signal that the file system backend is the entire |
198 | image. | | 198 | image. |
199 | .Pp | | 199 | .Pp |
200 | .Fn ukfs_release | | 200 | .Fn ukfs_release |
201 | unmounts the file system and releases the resources associated with | | 201 | unmounts the file system and releases the resources associated with |
202 | .Fa ukfs . | | 202 | .Fa ukfs . |
203 | The return value signals the return value of the unmount operation. | | 203 | The return value signals the return value of the unmount operation. |
204 | If non-zero, | | 204 | If non-zero, |
205 | .Fa ukfs | | 205 | .Fa ukfs |
206 | will continue to remain valid. | | 206 | will continue to remain valid. |
207 | The possible values for flags are: | | 207 | The possible values for flags are: |
208 | .Bl -tag -width XUKFS_RELFLAG_NOUNMOUT -offset indent | | 208 | .Bl -tag -width XUKFS_RELFLAG_NOUNMOUT -offset indent |
209 | .It Dv UKFS_RELFLAG_NOUNMOUNT | | 209 | .It Dv UKFS_RELFLAG_NOUNMOUNT |
210 | Do not unmount file system, just release ukfs handle. | | 210 | Do not unmount file system, just release ukfs handle. |
211 | Release always succeeds. | | 211 | Release always succeeds. |
212 | .It Dv UKFS_RELFLAG_FORCE | | 212 | .It Dv UKFS_RELFLAG_FORCE |
213 | Forcefully unmount the file system. | | 213 | Forcefully unmount the file system. |
214 | This means that any busy nodes (due to e.g. | | 214 | This means that any busy nodes (due to e.g. |
215 | .Fn ukfs_chdir ) | | 215 | .Fn ukfs_chdir ) |
216 | will be ignored. | | 216 | will be ignored. |
217 | Release always succeeds. | | 217 | Release always succeeds. |
218 | .El | | 218 | .El |
219 | .Sh OPERATION | | 219 | .Sh OPERATION |
220 | .Bl -ohang | | 220 | .Bl -ohang |
221 | .It Ft int | | 221 | .It Ft int |
222 | .Fn ukfs_chdir "struct ukfs *ukfs" "const char *path" | | 222 | .Fn ukfs_chdir "struct ukfs *ukfs" "const char *path" |
223 | .It Ft int | | 223 | .It Ft int |
224 | .Fn ukfs_getdents "struct ukfs *ukfs" "const char *dirname" "off_t *off" \ | | 224 | .Fn ukfs_getdents "struct ukfs *ukfs" "const char *dirname" "off_t *off" \ |
225 | "uint8_t *buf" "size_t bufsize" | | 225 | "uint8_t *buf" "size_t bufsize" |
226 | .It Ft ssize_t | | 226 | .It Ft ssize_t |
227 | .Fn ukfs_read "struct ukfs *ukfs" "const char *filename" "off_t off" \ | | 227 | .Fn ukfs_read "struct ukfs *ukfs" "const char *filename" "off_t off" \ |
228 | "uint8_t *buf" "size_t bufsize" | | 228 | "uint8_t *buf" "size_t bufsize" |
229 | .It Ft ssize_t | | 229 | .It Ft ssize_t |
230 | .Fn ukfs_write "struct ukfs *ukfs" "const char *filename" "off_t off" \ | | 230 | .Fn ukfs_write "struct ukfs *ukfs" "const char *filename" "off_t off" \ |
231 | "uint8_t *buf" "size_t bufsize" | | 231 | "uint8_t *buf" "size_t bufsize" |
232 | .It Ft int | | 232 | .It Ft int |
233 | .Fn ukfs_create "struct ukfs *ukfs" "const char *filename" "mode_t mode" | | 233 | .Fn ukfs_create "struct ukfs *ukfs" "const char *filename" "mode_t mode" |
234 | .It Ft int | | 234 | .It Ft int |
235 | .Fn ukfs_mknod "struct ukfs *ukfs" "const char *path" "mode_t mode" "dev_t dev" | | 235 | .Fn ukfs_mknod "struct ukfs *ukfs" "const char *path" "mode_t mode" "dev_t dev" |
236 | .It Ft int | | 236 | .It Ft int |
237 | .Fn ukfs_mkfifo "struct ukfs *ukfs" "const char *path" "mode_t mode" | | 237 | .Fn ukfs_mkfifo "struct ukfs *ukfs" "const char *path" "mode_t mode" |
238 | .It Ft int | | 238 | .It Ft int |
239 | .Fn ukfs_mkdir "struct ukfs *ukfs" "const char *filename" "mode_t mode" | | 239 | .Fn ukfs_mkdir "struct ukfs *ukfs" "const char *filename" "mode_t mode" |
240 | .It Ft int | | 240 | .It Ft int |
241 | .Fn ukfs_remove "struct ukfs *ukfs" "const char *filename" | | 241 | .Fn ukfs_remove "struct ukfs *ukfs" "const char *filename" |
242 | .It Ft int | | 242 | .It Ft int |
243 | .Fn ukfs_rmdir "struct ukfs *ukfs" "const char *filename" | | 243 | .Fn ukfs_rmdir "struct ukfs *ukfs" "const char *filename" |
244 | .It Ft int | | 244 | .It Ft int |
245 | .Fn ukfs_link "struct ukfs *ukfs" "const char *filename" "const char *f_create" | | 245 | .Fn ukfs_link "struct ukfs *ukfs" "const char *filename" "const char *f_create" |
246 | .It Ft int | | 246 | .It Ft int |
247 | .Fn ukfs_symlink "struct ukfs *ukfs" "const char *filename" \ | | 247 | .Fn ukfs_symlink "struct ukfs *ukfs" "const char *filename" \ |
248 | "const char *linkname" | | 248 | "const char *linkname" |
249 | .It Ft ssize_t | | 249 | .It Ft ssize_t |
250 | .Fn ukfs_readlink "struct ukfs *ukfs" "const char *filename" \ | | 250 | .Fn ukfs_readlink "struct ukfs *ukfs" "const char *filename" \ |
251 | "char *linkbuf" "size_t buflen" | | 251 | "char *linkbuf" "size_t buflen" |
252 | .It Ft int | | 252 | .It Ft int |
253 | .Fn ukfs_rename "struct ukfs *ukfs" "const char *from" "const char *to" | | 253 | .Fn ukfs_rename "struct ukfs *ukfs" "const char *from" "const char *to" |
254 | .It Ft int | | 254 | .It Ft int |
255 | .Fn ukfs_stat "struct ukfs *ukfs" "const char *filename" \ | | 255 | .Fn ukfs_stat "struct ukfs *ukfs" "const char *filename" \ |
256 | "struct stat *file_stat" | | 256 | "struct stat *file_stat" |
257 | .It Ft int | | 257 | .It Ft int |
258 | .Fn ukfs_lstat "struct ukfs *ukfs" "const char *filename" \ | | 258 | .Fn ukfs_lstat "struct ukfs *ukfs" "const char *filename" \ |
259 | "struct stat *file_stat" | | 259 | "struct stat *file_stat" |
260 | .It Ft int | | 260 | .It Ft int |
261 | .Fn ukfs_chmod "struct ukfs *ukfs" "const char *filename" "mode_t mode" | | 261 | .Fn ukfs_chmod "struct ukfs *ukfs" "const char *filename" "mode_t mode" |
262 | .It Ft int | | 262 | .It Ft int |
263 | .Fn ukfs_lchmod "struct ukfs *ukfs" "const char *filename" "mode_t mode" | | 263 | .Fn ukfs_lchmod "struct ukfs *ukfs" "const char *filename" "mode_t mode" |
264 | .It Ft int | | 264 | .It Ft int |
265 | .Fn ukfs_chown "struct ukfs *ukfs" "const char *filename" "uid_t uid" \ | | 265 | .Fn ukfs_chown "struct ukfs *ukfs" "const char *filename" "uid_t uid" \ |
266 | "gid_t gid" | | 266 | "gid_t gid" |
267 | .It Ft int | | 267 | .It Ft int |
268 | .Fn ukfs_lchown "struct ukfs *ukfs" "const char *filename" "uid_t uid" \ | | 268 | .Fn ukfs_lchown "struct ukfs *ukfs" "const char *filename" "uid_t uid" \ |
269 | "gid_t gid" | | 269 | "gid_t gid" |
270 | .It Ft int | | 270 | .It Ft int |
271 | .Fn ukfs_chflags "struct ukfs *ukfs" "const char *filename" "u_long flags" | | 271 | .Fn ukfs_chflags "struct ukfs *ukfs" "const char *filename" "u_long flags" |
272 | .It Ft int | | 272 | .It Ft int |
273 | .Fn ukfs_lchflags "struct ukfs *ukfs" "const char *filename" "u_long flags" | | 273 | .Fn ukfs_lchflags "struct ukfs *ukfs" "const char *filename" "u_long flags" |
274 | .It Ft int | | 274 | .It Ft int |
275 | .Fn ukfs_utimes "struct ukfs *ukfs" "const char *filename" \ | | 275 | .Fn ukfs_utimes "struct ukfs *ukfs" "const char *filename" \ |
276 | "const struct timeval *tptr" | | 276 | "const struct timeval *tptr" |
277 | .It Ft int | | 277 | .It Ft int |
278 | .Fn ukfs_lutimes "struct ukfs *ukfs" "const char *filename" \ | | 278 | .Fn ukfs_lutimes "struct ukfs *ukfs" "const char *filename" \ |
279 | "const struct timeval *tptr" | | 279 | "const struct timeval *tptr" |
280 | .El | | 280 | .El |
281 | .Pp | | 281 | .Pp |
282 | The above routines operate like their system call counterparts and the | | 282 | The above routines operate like their system call counterparts and the |
283 | system call manual pages without the ukfs_ prefix should be referred to | | 283 | system call manual pages without the ukfs_ prefix should be referred to |
284 | for further information on the parameters. | | 284 | for further information on the parameters. |
285 | .Pp | | 285 | .Pp |
286 | The only call which modifies | | 286 | The only call which modifies |
287 | .Fa ukfs | | 287 | .Fa ukfs |
288 | state is | | 288 | state is |
289 | .Fn ukfs_chdir . | | 289 | .Fn ukfs_chdir . |
290 | It works like | | 290 | It works like |
291 | .Xr chdir 2 | | 291 | .Xr chdir 2 |
292 | in the sense that it affects the interpretation of relative paths. | | 292 | in the sense that it affects the interpretation of relative paths. |
293 | If succesful, all relative pathnames will be resolved starting from the | | 293 | If succesful, all relative pathnames will be resolved starting from the |
294 | current directory. | | 294 | current directory. |
295 | Currently the call affects all accesses to that particular | | 295 | Currently the call affects all accesses to that particular |
296 | .Fa ukfs , | | 296 | .Fa ukfs , |
297 | but it might be later changed to be thread private. | | 297 | but it might be later changed to be thread private. |
298 | .Sh UTILITIES | | 298 | .Sh UTILITIES |
299 | .Bl -ohang | | 299 | .Bl -ohang |
300 | .It Ft int | | 300 | .It Ft int |
301 | .Fn ukfs_util_builddirs "struct ukfs *ukfs" "const char *pathname" "mode_t mode" | | 301 | .Fn ukfs_util_builddirs "struct ukfs *ukfs" "const char *pathname" "mode_t mode" |
302 | .El | | 302 | .El |
303 | .Pp | | 303 | .Pp |
304 | Builds a directory hierarchy. | | 304 | Builds a directory hierarchy. |
305 | Unlike mkdir, the | | 305 | Unlike mkdir, the |
306 | .Fa pathname | | 306 | .Fa pathname |
307 | argument may contain multiple levels of hierarchy. | | 307 | argument may contain multiple levels of hierarchy. |
308 | It is not considered an error if any of the directories specified exist | | 308 | It is not considered an error if any of the directories specified exist |
309 | already. | | 309 | already. |
310 | .Sh SEE ALSO | | 310 | .Sh SEE ALSO |
311 | .Xr rump 3 | | 311 | .Xr rump 3 |
312 | .Sh HISTORY | | 312 | .Sh HISTORY |
313 | .Nm | | 313 | .Nm |
314 | first appeared in | | 314 | first appeared in |
315 | .Nx 5.0 . | | 315 | .Nx 5.0 . |
316 | .Sh AUTHORS | | 316 | .Sh AUTHORS |
317 | .An Antti Kantee Aq Mt pooka@cs.hut.fi | | 317 | .An Antti Kantee Aq Mt pooka@cs.hut.fi |
318 | .Sh NOTES | | 318 | .Sh NOTES |
319 | .Nm | | 319 | .Nm |
320 | was an early attempt at an interface for kernel file systems | | 320 | was an early attempt at an interface for kernel file systems |
321 | running in userspace. | | 321 | running in userspace. |