1 .\" $NetBSD: prop_copyin_ioctl.9,v 1.6 2009/10/11 01:55:28 wiz Exp $
3 .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Jason R. Thorpe.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
31 .Dt PROP_COPYIN_IOCTL 9
34 .Nm prop_array_copyin_ioctl ,
35 .Nm prop_array_copyout_ioctl ,
36 .Nm prop_array_copyin ,
37 .Nm prop_dictionary_copyin_ioctl ,
38 .Nm prop_dictionary_copyout_ioctl ,
39 .Nm prop_dictionary_copyin
40 .Nd Copy property lists to and from kernel space
44 .Fn prop_array_copyin_ioctl "const struct plistref *pref" \
45 "const u_long cmd" "prop_array_t *arrayp"
47 .Fn prop_array_copyin "const struct plistref *pref" \
48 "prop_array_t *arrayp"
50 .Fn prop_array_copyout_ioctl "struct plistref *pref" \
51 "const u_long cmd" "prop_array_t array"
53 .Fn prop_dictionary_copyin_ioctl "const struct plistref *pref" \
54 "const u_long cmd" "prop_dictionary_t *dictp"
56 .Fn prop_dictionary_copyin "const struct plistref *pref" \
57 "prop_dictionary_t *dictp"
59 .Fn prop_dictionary_copyout_ioctl "struct plistref *pref" \
60 "const u_long cmd" "prop_dictionary_t dict"
63 .Nm prop_array_copyin_ioctl ,
64 .Nm prop_array_copyout_ioctl ,
65 .Nm prop_dictionary_copyin_ioctl ,
67 .Nm prop_dictionary_copyout_ioctl
68 functions implement the kernel side of a protocol for copying property lists
69 to and from the kernel using
74 .Nm prop_dictionary_copyin
75 implement the kernel side of a protocol for copying property lists to the
76 kernel as arguments of normal system calls.
78 A kernel routine receiving or returning a property list will be passed a
81 This structure encapsulates the reference to the property list in externalized
84 If successful, functions return zero.
85 Otherwise, an error number will be returned to indicate the error.
89 example demonstrates using
90 .Fn prop_dictionary_copyin_ioctl
92 .Fn prop_dictionary_copyout_ioctl
95 extern prop_dictionary_t fooprops;
98 fooioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
100 prop_dictionary_t dict, odict;
105 const struct plistref *pref = (const struct plistref *) data;
106 error = prop_dictionary_copyin_ioctl(pref, cmd, \*[Am]dict);
111 prop_object_release(odict);
116 struct plistref *pref = (struct plistref *) data;
117 error = prop_dictionary_copyout_ioctl(pref, cmd, fooprops);
122 return (EPASSTHROUGH);
130 example demonstrates using
131 .Fn prop_array_copyin
135 foocopyin(const struct plistref *pref))
140 error = prop_array_copyin(pref, \*[Am]array);
147 .Fn prop_array_copyin_ioctl
149 .Fn prop_dictionary_copyin_ioctl
157 Cannot allocate memory
162 .Fn prop_array_copyout_ioctl
164 .Fn prop_dictionary_copyout_ioctl
170 Cannot allocate memory
176 .Xr prop_dictionary 3 ,
177 .Xr prop_send_ioctl 3 ,
182 property container object library first appeared in