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

NAME

6       mcopyout - Convert an M_IOCTL or M_IOCDATA message to an M_COPYOUT
7

SYNOPSIS

9       #include <sys/stream.h>
10       #include <sys/strsun.h>
11
12
13
14       void mcopyout(mblk_t *mp, void *private, size_t size, void *useraddr,
15             mblk_t *dp);
16
17

INTERFACE LEVEL

19       Solaris DDI specific (Solaris DDI).
20

PARAMETERS

22       mp          M_IOCTL or M_IOCDATA message.
23
24
25       private     Value to set the cq_private field of the copyreq(9S) to.
26
27
28       size        Value to set the cq_size field of the copyreq(9S) to.
29
30
31       useraddr    Optionally, the value to set the cq_addr field of the copy‐
32                   req(9S) to.
33
34
35       dp          Optionally, the payload to copy out.
36
37

DESCRIPTION

39       The mcopyout() function converts an M_IOCTL or M_IOCDATA  message  into
40       an M_COPYOUT message using the supplied arguments.
41
42
43       To  convert the message, mcopyout() changes the message type to M_COPY‐
44       OUT, and its payload from a iocblk(9S)  to  a  copyreq(9S).  Since  the
45       iocblk(9S)  and  copyreq(9S)  are  designed to overlay one another, the
46       only fields which must be updated are cq_private, cq_size, and cq_addr,
47       which  are  set  to the supplied values. If useraddr is passed as NULL,
48       the M_IOCTL must be transparent and cq_addr is  assigned  the  pointer-
49       sized quantity found at mp->b_cont->b_rptr.
50
51
52       If  dp  is not NULL, any trailing message blocks associated with mp are
53       freed, mp->b_cont is reset to dp and dp->b_wptr is set to dp->b_rptr  +
54       size. Otherwise, any trailing message blocks are unaffected.
55

RETURN VALUES

57       None.
58

CONTEXT

60       This function can be called from user, kernel or interrupt context.
61

SEE ALSO

63       mcopyin(9F), copyreq(9S), iocblk(9S)
64
65
66       STREAMS Programming Guide
67
68
69
70SunOS 5.11                        9 June 2004                     mcopyout(9F)
Impressum