2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Portions Copyright 1989 AT&T
44 .\" Copyright 1994, The X/Open Company Ltd. All Rights Reserved.
45 .\" Portions Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved.
47 .TH T_SNDV 3NSL "Aug 23, 2001"
49 t_sndv \- send data or expedited data, from one or more non-contiguous buffers,
58 \fBint\fR \fBt_sndv\fR(\fBint\fR \fIfd\fR, \fBconst struct t_iovec *\fR\fIiov\fR, \fBunsigned int\fR \fIiovcount\fR, \fBint\fR \fIflags\fR);
64 This function is used to send either normal or expedited data. The argument
65 \fIfd\fR identifies the local transport endpoint over which data should be
66 sent, \fIiov\fR points to an array of buffer address/buffer length pairs.
67 \fBt_sndv()\fR sends data contained in buffers \fIiov\fR\fB0\fR\fI , \fR
68 \fIiov\fR\fB1\fR\fI ,\fR through \fIiov [iovcount-1]\fR\fB\&.\fR
69 \fIiovcount\fR contains the number of non-contiguous data buffers which is
70 limited to \fBT_IOV_MAX\fR, an implementation-defined value of at least 16.
71 If the limit is exceeded, the function fails with \fBTBADDATA\fR.
75 \fIiov(0).iov_len + . . + iov(iovcount-1).iov_len\fR)
81 Note that the limit on the total number of bytes available in all buffers
85 may be constrained by implementation limits. If no other constraint applies, it
86 will be limited by \fBINT_MAX\fR. In practice, the availability of memory to an
87 application is likely to impose a lower limit on the amount of data that can be
88 sent or received using scatter/gather functions.
91 The argument \fIflags\fR specifies any optional flags described below:
95 \fB\fBT_EXPEDITED\fR \fR
98 If set in \fIflags\fR, the data will be sent as expedited data and will be
99 subject to the interpretations of the transport provider.
108 If set in \fIflags\fR, this indicates to the transport provider that the
109 transport service data unit (TSDU) (or expedited transport service data unit -
110 ETSDU) is being sent through multiple \fBt_sndv()\fR calls. Each
111 \fBt_sndv()\fR with the \fBT_MORE\fR flag set indicates that another
112 \fBt_sndv()\fR or \fBt_snd\fR(3NSL) will follow with more data for the current
118 The end of the TSDU (or ETSDU) is identified by a \fBt_sndv()\fR call with the
119 \fBT_MORE\fR flag not set. Use of \fBT_MORE\fR enables a user to break up
120 large logical data units without losing the boundaries of those units at the
121 other end of the connection. The flag implies nothing about how the data is
122 packaged for transfer below the transport interface. If the transport provider
123 does not support the concept of a TSDU as indicated in the \fIinfo\fR argument
124 on return from \fBt_open\fR(3NSL) or \fBt_getinfo\fR(3NSL), the \fBT_MORE\fR
125 flag is not meaningful and will be ignored if set.
128 The sending of a zero-length fragment of a TSDU or ETSDU is only permitted
129 where this is used to indicate the end of a TSDU or ETSDU, that is, when the
130 \fBT_MORE\fR flag is not set. Some transport providers also forbid zero-length
134 If set in \fIflags\fR, requests that the provider transmit all data that it has
135 accumulated but not sent. The request is a local action on the provider and
136 does not affect any similarly named protocol flag (for example, the TCP PUSH
137 flag). This effect of setting this flag is protocol\(hydependent, and it may be
138 ignored entirely by transport providers which do not support the use of this
142 The communications provider is free to collect data in a send buffer until it
143 accumulates a sufficient amount for transmission.
146 By default, \fBt_sndv()\fR operates in synchronous mode and may wait if flow
147 control restrictions prevent the data from being accepted by the local
148 transport provider at the time the call is made. However, if \fBO_NONBLOCK\fR
149 is set by means of \fBt_open\fR(3NSL) or \fBfcntl\fR(2), \fBt_sndv()\fR
150 executes in asynchronous mode, and will fail immediately if there are flow
151 control restrictions. The process can arrange to be informed when the flow
152 control restrictions are cleared via either \fBt_look\fR(3NSL) or the EM
156 On successful completion, \fBt_sndv()\fR returns the number of bytes accepted
157 by the transport provider. Normally this will equal the total number of bytes
162 \fI(iov\fR\fB0.iov_len + .. + iov[iovcount-1].iov_len)\fR
168 However, the interface is constrained to send at most \fBINT_MAX\fR bytes in a
169 single send. When \fBt_sndv()\fR has submitted \fBINT_MAX\fR (or lower
170 constrained value, see the note above) bytes to the provider for a single call,
171 this value is returned to the user. However, if \fBO_NONBLOCK\fR is set or
172 the function is interrupted by a signal, it is possible that only part of the
173 data has actually been accepted by the communications provider. In this case,
174 \fBt_sndv()\fR returns a value that is less than the value of nbytes. If
175 \fBt_sndv()\fR is interrupted by a signal before it could transfer data to the
176 communications provider, it returns -1 \fBwith\fR \fBt_errno\fR set to
177 \fBTSYSERR\fR and \fBerrno\fR set to \fBEINTR\fR.
180 If the number of bytes of data in the \fIiov\fR array is zero and sending of
181 zero octets is not supported by the underlying transport service,
182 \fBt_sndv()\fR returns -1 \fBwith\fR \fBt_errno\fR set to \fBTBADDATA\fR.
185 The size of each TSDU or ETSDU must not exceed the limits of the transport
186 provider as specified by the current values in the TSDU or ETSDU fields in the
187 \fIinfo\fR argument returned by \fBt_getinfo\fR(3NSL).
190 The error \fBTLOOK\fR is returned for asynchronous events. It is required only
191 for an incoming disconnect event but may be returned for other events.
195 On successful completion, \fBt_sndv()\fR returns the number of bytes accepted
196 by the transport provider. Otherwise, -1 is returned on failure and
197 \fBt_errno\fR is set to indicate the error.
200 Note that in synchronous mode, if more than \fBINT_MAX\fR bytes of data are
201 passed in the \fIiov\fR array, only the first \fBINT_MAX\fR bytes will be
202 passed to the provider.
205 If the number of bytes accepted by the communications provider is less than the
206 number of bytes requested, this may either indicate that \fBO_NONBLOCK\fR is
207 set and the communications provider is blocked due to flow control, or that
208 \fBO_NONBLOCK\fR is clear and the function was interrupted by a signal.
212 \fBT_DATAXFER\fR, \fBT_INREL\fR.
216 On failure, \fBt_errno\fR is set to one of the following:
223 Illegal amount of data:
232 The specified file descriptor does not refer to a transport endpoint.
237 A single send was attempted specifying a TSDU (ETSDU) or fragment TSDU (ETSDU)
238 greater than that specified by the current values of the TSDU or ETSDU fields
239 in the \fIinfo\fR argument.
245 A send of a zero byte TSDU (ETSDU) or zero byte fragment of a TSDU (ETSDU) is
246 not supported by the provider.
252 Multiple sends were attempted resulting in a TSDU (ETSDU) larger than that
253 specified by the current value of the TSDU or ETSDU fields in the \fIinfo\fR
254 argument - the ability of an XTI implementation to detect such an error case is
255 implementation-dependent. See \fBWARNINGS\fR, below.
261 \fIiovcount\fR is greater than \fBT_IOV_MAX.\fR
271 An invalid flag was specified.
280 \fBO_NONBLOCK\fR was set, but the flow control mechanism prevented the
281 transport provider from accepting any data at this time.
290 An asynchronous event has occurred on this transport endpoint.
296 \fB\fBTNOTSUPPORT\fR\fR
299 This function is not supported by the underlying transport provider.
305 \fB\fBTOUTSTATE\fR\fR
308 The communications endpoint referenced by \fIfd\fR is not in one of the states
309 in which a call to this function is valid.
318 This error indicates that a communication problem has been detected between XTI
319 and the transport provider for which there is no other suitable XTI error
329 A system error has occurred during execution of this function.
332 .SH TLI COMPATIBILITY
335 In the \fBTLI\fR interface definition, no counterpart of this routine was
340 See \fBattributes\fR(5) for descriptions of the following attributes:
348 ATTRIBUTE TYPE ATTRIBUTE VALUE
356 \fBt_getinfo\fR(3NSL), \fBt_open\fR(3NSL), \fBt_rcvv\fR(3NSL)
357 \fBt_rcv\fR(3NSL), \fBt_snd\fR(3NSL), \fBattributes\fR(5)
361 It is important to remember that the transport provider treats all users of a
362 transport endpoint as a single user. Therefore if several processes issue
363 concurrent \fBt_sndv()\fR or \fBt_snd\fR(3NSL) calls, then the different data
367 Multiple sends which exceed the maximum TSDU or ETSDU size may not be
368 discovered by XTI. In this case an implementation-dependent error will result
369 (generated by the transport provider), perhaps on a subsequent XTI call. This
370 error may take the form of a connection abort, a \fBTSYSERR\fR, a
371 \fBTBADDATA\fR or a \fBTPROTO\fR error.
374 If multiple sends which exceed the maximum TSDU or ETSDU size are detected by
375 XTI, \fBt_sndv()\fR fails with \fBTBADDATA\fR.