'\" te .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved .\" 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. .\" 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. .\" 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] .TH mcopyout 9F "9 June 2004" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME mcopyout \- Convert an M_IOCTL or M_IOCDATA message to an M_COPYOUT .SH SYNOPSIS .LP .nf #include #include \fBvoid\fR \fBmcopyout\fR(\fBmblk_t *\fR\fImp\fR, \fBvoid *\fR\fIprivate\fR, \fBsize_t\fR \fIsize\fR, \fBvoid *\fR\fIuseraddr\fR, \fBmblk_t *\fR\fIdp\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fImp\fR\fR .ad .RS 12n .rt M_IOCTL or M_IOCDATA message. .RE .sp .ne 2 .mk .na \fB\fIprivate\fR\fR .ad .RS 12n .rt Value to set the cq_private field of the \fBcopyreq\fR(9S) to. .RE .sp .ne 2 .mk .na \fB\fIsize\fR\fR .ad .RS 12n .rt Value to set the cq_size field of the \fBcopyreq\fR(9S) to. .RE .sp .ne 2 .mk .na \fB\fIuseraddr\fR\fR .ad .RS 12n .rt Optionally, the value to set the cq_addr field of the \fBcopyreq\fR(9S) to. .RE .sp .ne 2 .mk .na \fB\fIdp\fR\fR .ad .RS 12n .rt Optionally, the payload to copy out. .RE .SH DESCRIPTION .sp .LP The \fBmcopyout()\fR function converts an M_IOCTL or M_IOCDATA message into an M_COPYOUT message using the supplied arguments. .sp .LP To convert the message, \fBmcopyout()\fR changes the message type to M_COPYOUT, and its payload from a \fBiocblk\fR(9S) to a \fBcopyreq\fR(9S). Since the \fBiocblk\fR(9S) and \fBcopyreq\fR(9S) are designed to overlay one another, the only fields which must be updated are \fBcq_private\fR, \fBcq_size\fR, and \fBcq_addr\fR, which are set to the supplied values. If \fIuseraddr\fR is passed as NULL, the M_IOCTL must be transparent and \fBcq_addr\fR is assigned the pointer-sized quantity found at \fBmp->b_cont->b_rptr\fR. .sp .LP If \fIdp\fR is not NULL, any trailing message blocks associated with \fImp\fR are freed, \fBmp->b_cont\fR is reset to \fIdp\fR and \fBdp->b_wptr\fR is set to \fBdp->b_rptr + size\fR. Otherwise, any trailing message blocks are unaffected. .SH RETURN VALUES .sp .LP None. .SH CONTEXT .sp .LP This function can be called from user, kernel or interrupt context. .SH SEE ALSO .sp .LP \fBmcopyin\fR(9F), \fBcopyreq\fR(9S), \fBiocblk\fR(9S) .sp .LP \fISTREAMS Programming Guide\fR