2 .\" Copyright (c) 2003, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LDI_PUTMSG 9F "Jun 3, 2003"
8 ldi_putmsg, ldi_getmsg \- Read/write message blocks from/to a stream
12 #include <sys/sunldi.h>
14 \fBint\fR \fBldi_putmsg\fR(\fBldi_handle_t\fR\fI lh\fR, \fBmblk_t *\fR\fIsmp\fR);
19 \fBint\fR \fB ldi_getmsg\fR(\fBldi_handle_t\fR \fIlh\fR, \fBmblk_t **\fR\fIrmp\fR, \fBtimestruc_t *\fR\fItimeo\fR);
38 Message block to send.
47 Message block to receive.
56 Optional timeout for data reception.
62 The \fBldi_putmsg\fR function allows a caller to send a message block to a
63 streams device specified by the layered handle \fIlh\fR. Once the message (smp)
64 has been passed to \fBldi_putmsg()\fR, the caller must not free the message
65 even if an error occurs.
68 The \fBldi_getmsg()\fR function allows a caller to receive a message block from
69 a streams device specified by the layered handle \fIlh\fR. Callers must free
70 the message received with \fBfreemsg\fR(9F).
73 If a NULL timeout value is specified when the caller receives a message, the
74 caller sleeps until a message is received.
78 The \fBldi_putmsg()\fR and \fBldi_getmsg()\fR functions return \fB0\fR upon
79 success. If a failure occurs before the request is passed to the device, the
80 possible return values are shown below. Otherwise any other error number may be
81 returned by the device.
88 Invalid input parameters.
97 Operation is not supported for this device.
99 The \fBldi_getmsg()\fR function may also return:
106 Returned if the timeout \fBtimeo\fR expires with no messages received.
114 These functions may be called from user or kernel context.