1merror(9F)               Kernel Functions for Drivers               merror(9F)
2
3
4

NAME

6       merror - Send an M_ERROR message upstream
7

SYNOPSIS

9       #include <sys/stream.h>
10       #include <sys/strsun.h>
11
12
13
14       void merror(queue_t *wq, mblk_t *mp, int error);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI).
19

PARAMETERS

21       wq       Write queue associated with the read queue to send the M_ERROR
22                on.
23
24
25       mp       Optionally, a STREAMS message to convert to an M_ERROR.
26
27
28       error    Error code to include in the M_ERROR message.
29
30

DESCRIPTION

32       The merror() function constructs an  M_ERROR  message,  and  sends  the
33       resulting message upstream.
34
35
36       If  mp is NULL, merror() allocates a one-byte M_ERROR message. If mp is
37       non-NULL, merror() attempts to convert  the  passed-in  message  to  an
38       M_ERROR.  However, if the passed-in message has more than one reference
39       (see dupmsg(9F)), or if it is of zero length, it is  freed  and  a  new
40       message is allocated.
41
42
43       If  the allocation or conversion fails, merror() silently fails. Other‐
44       wise, the resulting one-byte data block is assigned the specified error
45       code and sent upstream.
46

RETURN VALUES

48       None.
49

CONTEXT

51       This function can be called from user, kernel or interrupt context.
52

NOTES

54       Callers must not hold any locks across an merror() that can be acquired
55       as part of put(9E) processing.
56

SEE ALSO

58       put(9E), dupmsg(9F)
59
60
61       STREAMS Programming Guide
62
63
64
65SunOS 5.11                        9 June 2004                       merror(9F)
Impressum