Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / mcopyin.9f
blobcd131ee1171e6a3f745a44a7613c7598856bef42
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH MCOPYIN 9F "Jun 9, 2004"
7 .SH NAME
8 mcopyin \- Convert an M_IOCTL or M_IOCDATA message to an M_COPYIN
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/stream.h>
13 #include <sys/strsun.h>
17 \fBvoid\fR \fBmcopyin\fR(\fBmblk_t *\fR\fImp\fR, \fBvoid *\fR\fIprivate\fR, \fBsize_t\fR \fIsize\fR,
18      \fBvoid *\fR \fIuseraddr\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Solaris DDI specific (Solaris DDI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fImp\fR\fR
30 .ad
31 .RS 12n
32 M_IOCTL or M_IOCDATA message.
33 .RE
35 .sp
36 .ne 2
37 .na
38 \fB\fIprivate\fR\fR
39 .ad
40 .RS 12n
41 Value to which the \fBcq_private\fR field of \fBcopyreq\fR(9S) is set.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fIsize\fR\fR
48 .ad
49 .RS 12n
50 Value to which the \fBcq_size\fR field of \fBcopyreq\fR(9S) is set.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fB\fIuseraddr\fR\fR
57 .ad
58 .RS 12n
59 Optionally, the value to which the \fBcq_addr\fR field of \fBcopyreq\fR(9S) is
60 set.
61 .RE
63 .SH DESCRIPTION
64 .sp
65 .LP
66 The \fBmcopyin()\fR function converts an M_IOCTL or M_IOCDATA message into an
67 M_COPYIN message using the supplied arguments.
68 .sp
69 .LP
70 To convert the message, \fBmcopyin()\fR changes the message type to M_COPYIN,
71 and its payload from a \fBiocblk\fR(9S) to a \fBcopyreq\fR(9S). Since the
72 \fBiocblk\fR(9S) and \fBcopyreq\fR(9S) are designed to overlay one another, the
73 only fields which must be updated are \fBcq_private\fR, \fBcq_size\fR, and
74 \fBcq_addr\fR, which are set to the supplied values. If \fIuseraddr\fR is
75 passed as NULL, \fImp\fR must be a transparent M_IOCTL, and \fBcq_addr\fR is
76 assigned the pointer-sized quantity found at \fBmp->b_cont->b_rptr\fR.
77 .sp
78 .LP
79 Any trailing message blocks associated with \fImp\fR are freed.
80 .SH RETURN VALUES
81 .sp
82 .LP
83 None.
84 .SH CONTEXT
85 .sp
86 .LP
87 This function can be called from user, kernel or interrupt context.
88 .SH SEE ALSO
89 .sp
90 .LP
91 \fBmcopyout\fR(9F), \fBcopyreq\fR(9S)
92 .sp
93 .LP
94 \fISTREAMS Programming Guide\fR