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"
8 mcopyin \- Convert an M_IOCTL or M_IOCDATA message to an M_COPYIN
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);
24 Solaris DDI specific (Solaris DDI).
32 M_IOCTL or M_IOCDATA message.
41 Value to which the \fBcq_private\fR field of \fBcopyreq\fR(9S) is set.
50 Value to which the \fBcq_size\fR field of \fBcopyreq\fR(9S) is set.
59 Optionally, the value to which the \fBcq_addr\fR field of \fBcopyreq\fR(9S) is
66 The \fBmcopyin()\fR function converts an M_IOCTL or M_IOCDATA message into an
67 M_COPYIN message using the supplied arguments.
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.
79 Any trailing message blocks associated with \fImp\fR are freed.
87 This function can be called from user, kernel or interrupt context.
91 \fBmcopyout\fR(9F), \fBcopyreq\fR(9S)
94 \fISTREAMS Programming Guide\fR