8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3nsl / t_sndudata.3nsl
blob6c98c5ce737a9e5abebaeb493b97444af63c369b
1 '\" te
2 .\"  Copyright 1994, The X/Open Company Ltd.  All Rights Reserved  Portions Copyright 1989 AT&T  Portions Copyright (c) 1998, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" 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.
8 .\" 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.
9 .\" 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]
10 .TH T_SNDUDATA 3NSL "May 7, 1998"
11 .SH NAME
12 t_sndudata \- send a data unit
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <xti.h>
21 \fBint\fR \fBt_sndudata\fR(\fBint\fR \fIfd\fR, \fBconst struct t_unitdata *\fR\fIunitdata\fR);
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
27 This routine is part of the \fBXTI\fR interfaces which evolved from the
28 \fBTLI\fR interfaces. \fBXTI\fR represents the future evolution of these
29 interfaces. However, \fBTLI\fR interfaces are supported for compatibility. When
30 using a \fBTLI\fR routine that has the same name as an \fBXTI\fR routine, the
31 \fBtiuser.h\fR header file must be used.  Refer to the  \fBTLI\fR
32 \fBCOMPATIBILITY\fR section for a description of differences between the two
33 interfaces.
34 .sp
35 .LP
36 This function is used in connectionless-mode to send a data unit to another
37 transport user. The argument \fIfd\fR identifies the local transport endpoint
38 through which data will be sent, and \fIunitdata\fR points to a
39 \fBt_unitdata\fR structure containing the following members:
40 .sp
41 .in +2
42 .nf
43 struct netbuf addr;
44 struct netbuf opt;
45 struct netbuf udata;
46 .fi
47 .in -2
49 .sp
50 .LP
51 In \fIunitdata\fR, \fIaddr\fR specifies the protocol address of the destination
52 user, \fIopt\fR identifies options that the user wants associated with this
53 request, and \fIudata\fR specifies the user data to be sent. The user may
54 choose not to specify what protocol options are associated with the transfer by
55 setting the \fIlen\fR field of \fIopt\fR to zero. In this case, the provider
56 uses the option values currently set for the communications endpoint.
57 .sp
58 .LP
59 If the \fIlen\fR field of \fIudata\fR is zero, and sending of zero octets is
60 not supported by the underlying transport service, the \fBt_sndudata()\fR will
61 return  -1 with \fBt_errno\fR set to \fBTBADDATA\fR.
62 .sp
63 .LP
64 By default, \fBt_sndudata()\fR operates in synchronous mode and may wait if
65 flow control restrictions prevent the data from being accepted by the local
66 transport provider at the time the call is made.  However, if  \fBO_NONBLOCK\fR
67 \fBis\fR \fBset\fR \fBby\fR \fBmeans\fR \fBof\fR \fBt_open\fR(3NSL) or
68 \fBfcntl\fR(2), \fBt_sndudata()\fR will execute in asynchronous mode and will
69 fail under such conditions. The process can arrange to be notified of the
70 clearance of a flow control restriction by means of either \fBt_look\fR(3NSL)
71 or the EM interface.
72 .sp
73 .LP
74 If the amount of data specified in \fIudata\fR exceeds the TSDU size as
75 returned in the \fItsdu\fR field of the \fIinfo\fR argument of
76 \fBt_open\fR(3NSL) or \fBt_getinfo\fR(3NSL), a \fBTBADDATA\fR error will be
77 generated. If \fBt_sndudata()\fR is called before the destination user has
78 activated its transport endpoint (see \fBt_bind\fR(3NSL)), the data unit may be
79 discarded.
80 .sp
81 .LP
82 If it is not possible for the transport provider to immediately detect the
83 conditions that cause the errors \fBTBADDADDR\fR and \fBTBADOPT\fR, these
84 errors will alternatively be returned by \fIt_rcvuderr.\fR Therefore, an
85 application must be prepared to receive these errors in both of these ways.
86 .sp
87 .LP
88 If the call is interrupted, \fBt_sndudata()\fR will return \fBEINTR\fR and the
89 datagram will not be sent.
90 .SH RETURN VALUES
91 .sp
92 .LP
93 Upon successful completion, a value of  \fB0\fR is returned.  Otherwise, a
94 value of  -1 is returned and \fBt_errno\fR is set to indicate an error.
95 .SH VALID STATES
96 .sp
97 .LP
98 \fBT_IDLE\fR.
99 .SH ERRORS
102 On failure, \fBt_errno\fR is set to one of the following:
104 .ne 2
106 \fB\fBTBADADDR\fR\fR
108 .RS 15n
109 The specified protocol address was in an incorrect format or contained illegal
110 information.
114 .ne 2
116 \fB\fBTBADDATA\fR\fR
118 .RS 15n
119 Illegal amount of data. A single send was attempted specifying a TSDU greater
120 than that specified in the \fIinfo\fR argument, or a send of a zero byte TSDU
121 is not supported by the provider.
125 .ne 2
127 \fB\fBTBADF\fR\fR
129 .RS 15n
130 The specified file descriptor does not refer to a transport endpoint.
134 .ne 2
136 \fB\fBTBADOPT\fR\fR
138 .RS 15n
139 The specified options were in an incorrect format or contained illegal
140 information.
144 .ne 2
146 \fB\fBTFLOW\fR\fR
148 .RS 15n
149 \fBO_NONBLOCK\fR was set, but the flow control mechanism prevented the
150 transport provider from accepting any data at this time.
154 .ne 2
156 \fB\fBTLOOK\fR\fR
158 .RS 15n
159 An asynchronous event has occurred on this transport endpoint.
163 .ne 2
165 \fB\fBTNOTSUPPORT\fR\fR
167 .RS 15n
168 This function is not supported by the underlying transport provider.
172 .ne 2
174 \fB\fBTOUTSTATE\fR\fR
176 .RS 15n
177 The communications endpoint referenced by  \fIfd\fR is not in one of the states
178 in which a call to this function is valid.
182 .ne 2
184 \fB\fBTPROTO\fR\fR
186 .RS 15n
187 This error indicates that a communication problem has been detected between XTI
188 and the transport provider for which there is no other suitable XTI error
189 \fB(t_errno)\fR.
193 .ne 2
195 \fB\fBTSYSERR\fR\fR
197 .RS 15n
198 A system error has occurred during execution of this function.
201 .SH TLI COMPATIBILITY
204 The \fBXTI\fR and \fBTLI\fR interface definitions have common names but use
205 different header files. This, and other semantic differences between the two
206 interfaces are described in the subsections below.
207 .SS "Interface Header"
210 The \fBXTI\fR interfaces use the header file, \fBxti.h.\fR \fBTLI\fR interfaces
211 should \fInot\fR use this header.  They should use the header:
213 .in +2
214 #include <tiuser.h>
215 .in -2
216 .SS "Error Description Values"
219 The \fBt_errno\fR values that can be set by the \fBXTI\fR interface and cannot
220 be set by the \fBTLI\fR interface are:
222 .in +2
223 \fBTPROTO\fR
224 .in -2
226 .in +2
227 \fBTBADADDR\fR
228 .in -2
230 .in +2
231 \fBTBADOPT\fR
232 .in -2
234 .in +2
235 \fBTLOOK\fR
236 .in -2
238 .in +2
239 \fBTOUTSTATE\fR
240 .in -2
241 .SS "Notes"
244 Whenever this function fails with \fBt_error\fR set to \fBTFLOW,\fR
245 \fBO_NONBLOCK\fR must have been set.
246 .SS "Option Buffers"
249 The format of the options in an \fBopt\fR buffer is dictated by the transport
250 provider. Unlike the \fBXTI\fR interface, the \fBTLI\fR interface does not fix
251 the buffer format.
252 .SH ATTRIBUTES
255 See \fBattributes\fR(5)  for descriptions of the following attributes:
260 box;
261 c | c
262 l | l .
263 ATTRIBUTE TYPE  ATTRIBUTE VALUE
265 MT Level        Safe
268 .SH SEE ALSO
271 \fBfcntl\fR(2), \fBt_alloc\fR(3NSL), \fBt_bind\fR(3NSL), \fBt_error\fR(3NSL),
272 \fBt_getinfo\fR(3NSL), \fBt_look\fR(3NSL), \fBt_open\fR(3NSL),
273 \fBt_rcvudata\fR(3NSL), \fBt_rcvuderr\fR(3NSL), \fBattributes\fR(5)