'\" 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 "Jun 9, 2004" .SH NAME mcopyout \- Convert an M_IOCTL or M_IOCDATA message to an M_COPYOUT .SH SYNOPSIS .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 illumos DDI specific (illumos DDI). .SH PARAMETERS .ne 2 .na \fB\fImp\fR\fR .ad .RS 12n M_IOCTL or M_IOCDATA message. .RE .sp .ne 2 .na \fB\fIprivate\fR\fR .ad .RS 12n Value to set the cq_private field of the \fBcopyreq\fR(9S) to. .RE .sp .ne 2 .na \fB\fIsize\fR\fR .ad .RS 12n Value to set the cq_size field of the \fBcopyreq\fR(9S) to. .RE .sp .ne 2 .na \fB\fIuseraddr\fR\fR .ad .RS 12n Optionally, the value to set the cq_addr field of the \fBcopyreq\fR(9S) to. .RE .sp .ne 2 .na \fB\fIdp\fR\fR .ad .RS 12n Optionally, the payload to copy out. .RE .SH DESCRIPTION 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 None. .SH CONTEXT This function can be called from user, kernel or interrupt context. .SH SEE ALSO .BR mcopyin (9F), .BR copyreq (9S), .BR iocblk (9S) .sp .LP \fISTREAMS Programming Guide\fR