'\" te .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved .TH merror 9F "9 June 2004" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME merror \- Send an M_ERROR message upstream .SH SYNOPSIS .LP .nf #include #include \fBvoid\fR \fBmerror\fR(\fBqueue_t *\fR\fIwq\fR, \fBmblk_t *\fR\fImp\fR, \fBint\fR \fIerror\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIwq\fR\fR .ad .RS 9n .rt Write queue associated with the read queue to send the M_ERROR on. .RE .sp .ne 2 .mk .na \fB\fImp\fR\fR .ad .RS 9n .rt Optionally, a STREAMS message to convert to an M_ERROR. .RE .sp .ne 2 .mk .na \fB\fIerror\fR\fR .ad .RS 9n .rt Error code to include in the M_ERROR message. .RE .SH DESCRIPTION .sp .LP The \fBmerror()\fR function constructs an M_ERROR message, and sends the resulting message upstream. .sp .LP If \fImp\fR is NULL, \fBmerror()\fR allocates a one-byte M_ERROR message. If \fImp\fR is non-NULL, \fBmerror()\fR attempts to convert the passed-in message to an M_ERROR. However, if the passed-in message has more than one reference (see \fBdupmsg\fR(9F)), or if it is of zero length, it is freed and a new message is allocated. .sp .LP If the allocation or conversion fails, \fBmerror()\fR silently fails. Otherwise, the resulting one-byte data block is assigned the specified error code and sent upstream. .SH RETURN VALUES .sp .LP None. .SH CONTEXT .sp .LP This function can be called from user, kernel or interrupt context. .SH NOTES .sp .LP Callers must not hold any locks across an \fBmerror()\fR that can be acquired as part of \fBput\fR(9E) processing. .SH SEE ALSO .sp .LP \fBput\fR(9E), \fBdupmsg\fR(9F) .sp .LP \fISTREAMS Programming Guide\fR