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

NAME

6       ldi_putmsg, ldi_getmsg - Read/write message blocks from/to a stream
7

SYNOPSIS

9       #include <sys/sunldi.h>
10
11       int ldi_putmsg(ldi_handle_t lh, mblk_t *smp);
12
13
14       int  ldi_getmsg(ldi_handle_t lh, mblk_t **rmp, timestruc_t *timeo);
15
16

PARAMETERS

18       lh        Layered handle.
19
20
21       smp       Message block to send.
22
23
24       rmp       Message block to receive.
25
26
27       timeo     Optional timeout for data reception.
28
29

DESCRIPTION

31       The  ldi_putmsg  function  allows a caller to send a message block to a
32       streams device specified by the layered handle  lh.  Once  the  message
33       (smp)  has  been  passed  to ldi_putmsg(), the caller must not free the
34       message even if an error occurs.
35
36
37       The ldi_getmsg() function allows a caller to receive  a  message  block
38       from  a streams device specified by the layered handle lh. Callers must
39       free the message received with freemsg(9F).
40
41
42       If a NULL timeout value is specified when the caller  receives  a  mes‐
43       sage, the caller sleeps until a message is received.
44

RETURN VALUES

46       The ldi_putmsg() and ldi_getmsg() functions return 0 upon success. If a
47       failure occurs before the request is passed to the device, the possible
48       return  values are shown below. Otherwise any other error number may be
49       returned by the device.
50
51       EINVAL     Invalid input parameters.
52
53
54       ENOTSUP    Operation is not supported for this device.
55
56                  The ldi_getmsg() function may also return:
57
58                  ETIME    Returned if the timeout timeo expires with no  mes‐
59                           sages received.
60
61
62

CONTEXT

64       These functions may be called from user or kernel context.
65
66
67
68SunOS 5.11                        3 June 2003                   ldi_putmsg(9F)
Impressum