Kernel Functions for Drivers merror(9F)
NAME
merror - Send an MEROR message upstream
SYNOPSIS
#include
#include
void merror(queuet *wq, mblkt *mp, int error);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
PARAMETERS
wq Write queue associated with the read queue to send
the MEROR on.
mp Optionally, a STREAMS message to convert to an
MEROR.
error Error code to include in the MEROR message.
DESCRIPTION
The merror() function constructs an MEROR message, and
sends the resulting message upstream.
If mp is NUL, merror() allocates a one-byte MEROR mes-
sage. If mp is non-NUL, merror() attempts to convert the
passed-in message to an MEROR. However, if the passed-in
message has more than one reference (see dupmsg(9F)), or if
it is of zero length, it is freed and a new message is allo-
cated.
If the allocation or conversion fails, merror() silently
fails. Otherwise, the resulting one-byte data block is
assigned the specified error code and sent upstream.
RETURN VALUES
None.
CONTEXT
This function can be called from user, kernel or interrupt
context.
SunOS 5.11 Last change: 9 June 2004 1
Kernel Functions for Drivers merror(9F)
NOTES
Callers must not hold any locks across an merror() that can
be acquired as part of put(9E) processing.
SEE ALSO
put(9E), dupmsg(9F)
STREAMS Programming Guide
SunOS 5.11 Last change: 9 June 2004 2
|