1 .\" $NetBSD: p2k.3,v 1.6 2009/11/21 12:28:51 pooka Exp $
3 .\" Copyright (c) 2008 Antti Kantee. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
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
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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
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
31 .Nd puffs to kernel vfs translation library
33 p2k Library (libp2k, \-lp2k)
36 .Ft struct p2k_mount *
37 .Fn p2k_init "uint32_t puffs_flags"
39 .Fn p2k_cancel "struct p2k_mount *p2m" "int error"
42 .Fa "struct p2k_mount *p2m" "const char *vfsname" "const char *devpath"
43 .Fa "const char *mountpath" "int mntflags" "void *arg" "size_t alen"
46 .Fa "struct p2k_mount *p2m" "const char *vfsname" "const char *devpath"
47 .Fa "int partition" "const char *mountpath" "int mntflags"
48 .Fa "void *arg" "size_t alen"
51 .Fn p2k_mainloop "struct p2k_mount *p2m"
54 .Fa "const char *vfsname" "const char *devpath" "const char *mountpath"
55 .Fa "int mntflags" "void *arg" "size_t alen" "uint32_t puffs_flags"
59 .Fa "const char *vfsname" "const char *devpath" "int partition"
60 .Fa "const char *mountpath" "int mntflags" "void *arg" "size_t alen"
61 .Fa "uint32_t puffs_flags"
66 library translates the puffs protocol to the kernel vfs protocol and
68 It can therefore be used to mount and run kernel file system code as
71 Calling the library interface function mounts the file system and,
72 if succesful, starts handling requests.
73 The parameters are handled by
77 with the exception that
83 The "run_fs" variants of the interfaces are provided as a convenience
85 They execute all of init, setup and mainloop in one call.
87 The following environment variables affect the behaviour of
89 They are useful mostly for debugging purposes.
90 The flags are environment variables because typically the command line
93 utilities are parsed using versions not aware of
95 options; for example, the
97 arguments are really parsed by
99 .Bl -tag -width "XP2K_NOCACHE_PAGE"
101 Do not detach from tty and print information about each puffs operation.
103 Do not detach from tty.
104 .It Dv P2K_NOCACHE_PAGE
105 Do not use the puffs page cache.
106 .It Dv P2K_NOCACHE_NAME
107 Do not use the puffs name cache.
109 Do not use the puffs page or name cache.
111 If set, use the value of the variable to determine the UID of the
112 caller of each operation instead of the actual caller supplied by
114 This can be used for example to simplify modifying an OS installations
115 root image as a non-root user.
116 If the variable is set but does not contain an integer value, 0
133 .Xr rump_syspuffs 8 ,